typenative 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +1 -0
- package/.github/workflows/ci.yml +39 -2
- package/.github/workflows/npm-publish-github-packages.yml +7 -2
- package/CHANGELOG.md +293 -0
- package/CONTRIBUTION.md +8 -6
- package/README.md +15 -11
- package/bin/cli.js +7 -1
- package/bin/go/bridge.js +919 -0
- package/bin/go/convert.js +238 -0
- package/bin/go/metadata.js +211 -0
- package/bin/go/overrides.js +68 -0
- package/bin/go/stdlib.generated.js +175 -0
- package/bin/index.js +337 -239
- package/bin/main.js +9 -2
- package/bin/node/assert.js +344 -0
- package/bin/node/async_hooks.js +273 -0
- package/bin/node/buffer.js +765 -0
- package/bin/node/child_process.js +600 -0
- package/bin/node/cluster.js +1002 -0
- package/bin/node/console.js +121 -0
- package/bin/node/core.js +111 -0
- package/bin/node/crypto.js +414 -0
- package/bin/node/crypto_keys.js +2685 -0
- package/bin/node/dgram.js +388 -0
- package/bin/node/diagnostics_channel.js +534 -0
- package/bin/node/dns.js +635 -0
- package/bin/node/events.js +743 -0
- package/bin/node/fetch.js +737 -0
- package/bin/node/fs.js +998 -0
- package/bin/node/http.js +1500 -0
- package/bin/node/http2.js +688 -0
- package/bin/node/net.js +1143 -0
- package/bin/node/os.js +257 -0
- package/bin/node/path.js +758 -0
- package/bin/node/process.js +316 -0
- package/bin/node/punycode.js +195 -0
- package/bin/node/querystring.js +143 -0
- package/bin/node/readline.js +299 -0
- package/bin/node/registry.js +161 -0
- package/bin/node/sqlite.js +1142 -0
- package/bin/node/stream.js +1221 -0
- package/bin/node/stream_web.js +2259 -0
- package/bin/node/string_decoder.js +101 -0
- package/bin/node/system_extra.js +714 -0
- package/bin/node/test.js +1068 -0
- package/bin/node/timers.js +263 -0
- package/bin/node/tls.js +719 -0
- package/bin/node/url.js +861 -0
- package/bin/node/util.js +1311 -0
- package/bin/node/util_extra.js +599 -0
- package/bin/node/worker_threads.js +745 -0
- package/bin/node/zlib.js +263 -0
- package/bin/parse-native.js +10 -0
- package/bin/parse-node.js +10 -0
- package/bin/transpiler.js +2824 -588
- package/bin/typecheck-node.js +78 -0
- package/bin/version.js +2 -0
- package/conformance.md +708 -241
- package/govendor/github.com/ncruces/go-sqlite3/LICENSE +21 -0
- package/govendor/github.com/ncruces/go-sqlite3/README.md +121 -0
- package/govendor/github.com/ncruces/go-sqlite3/backup.go +132 -0
- package/govendor/github.com/ncruces/go-sqlite3/blob.go +266 -0
- package/govendor/github.com/ncruces/go-sqlite3/config.go +397 -0
- package/govendor/github.com/ncruces/go-sqlite3/conn.go +540 -0
- package/govendor/github.com/ncruces/go-sqlite3/conn_127.go +93 -0
- package/govendor/github.com/ncruces/go-sqlite3/const.go +436 -0
- package/govendor/github.com/ncruces/go-sqlite3/context.go +222 -0
- package/govendor/github.com/ncruces/go-sqlite3/error.go +182 -0
- package/govendor/github.com/ncruces/go-sqlite3/ext.go +153 -0
- package/govendor/github.com/ncruces/go-sqlite3/func.go +309 -0
- package/govendor/github.com/ncruces/go-sqlite3/go.mod +3 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk.go +29 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_other.go +13 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_unix.go +57 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/errutil/error.go +41 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/alloc.go +128 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/const.go +122 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/error.go +77 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem.go +116 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_other.go +34 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_unix.go +87 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_windows.go +149 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mmap_unix.go +80 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mmap_windows.go +129 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/sys_windows.go +60 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap.go +82 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap_sys.go +113 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap_vfs.go +181 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/testenv/env.go +55 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/json.go +54 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/json_v2.go +54 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/math.go +29 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/page.go +5 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/parse.go +142 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/pointer.go +3 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/reflect.go +10 -0
- package/govendor/github.com/ncruces/go-sqlite3/json.go +100 -0
- package/govendor/github.com/ncruces/go-sqlite3/json_v2.go +116 -0
- package/govendor/github.com/ncruces/go-sqlite3/pointer.go +13 -0
- package/govendor/github.com/ncruces/go-sqlite3/quote.go +140 -0
- package/govendor/github.com/ncruces/go-sqlite3/stmt.go +692 -0
- package/govendor/github.com/ncruces/go-sqlite3/time.go +360 -0
- package/govendor/github.com/ncruces/go-sqlite3/txn.go +374 -0
- package/govendor/github.com/ncruces/go-sqlite3/value.go +212 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/README.md +133 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/api.go +239 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/cksm.go +143 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/const.go +256 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/file.go +260 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/filename.go +187 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/lock.go +128 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/lock_other.go +23 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/map.go +63 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/map_other.go +13 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_bsd.go +110 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go +131 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_dotlk.go +140 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_f2fs_linux.go +56 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go +117 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_ofd.go +59 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std.go +50 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_alloc.go +19 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_atomic.go +9 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_rw.go +13 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_sync.go +9 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_temp.go +16 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go +108 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go +180 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/registry.go +48 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm.go +26 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_bsd.go +258 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_copy.go +90 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go +168 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_memlk.go +52 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go +185 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_other.go +21 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_windows.go +124 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/vfs.go +455 -0
- package/govendor/github.com/ncruces/go-sqlite3/vtab.go +677 -0
- package/govendor/github.com/ncruces/go-sqlite3/wrap.go +48 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/LICENSE +18 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/README.md +11 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/go.mod +3 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/libc.go +215 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/sqlite3.dat +0 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/sqlite3.go +157903 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/tools.sh +38 -0
- package/govendor/github.com/ncruces/julianday/LICENSE +21 -0
- package/govendor/github.com/ncruces/julianday/README.md +9 -0
- package/govendor/github.com/ncruces/julianday/go.mod +3 -0
- package/govendor/github.com/ncruces/julianday/julianday.go +124 -0
- package/govendor/golang.org/x/sys/LICENSE +27 -0
- package/govendor/golang.org/x/sys/PATENTS +22 -0
- package/govendor/golang.org/x/sys/go.mod +3 -0
- package/govendor/golang.org/x/sys/unix/README.md +184 -0
- package/govendor/golang.org/x/sys/unix/affinity_linux.go +189 -0
- package/govendor/golang.org/x/sys/unix/aliases.go +13 -0
- package/govendor/golang.org/x/sys/unix/asm_aix_ppc64.s +17 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_386.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_amd64.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_arm.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_arm64.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_ppc64.s +29 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_riscv64.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_386.s +65 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_amd64.s +57 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_arm.s +56 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_arm64.s +50 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_loong64.s +51 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_mips64x.s +54 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_mipsx.s +52 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +42 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_riscv64.s +47 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_s390x.s +54 -0
- package/govendor/golang.org/x/sys/unix/asm_openbsd_mips64.s +29 -0
- package/govendor/golang.org/x/sys/unix/asm_solaris_amd64.s +17 -0
- package/govendor/golang.org/x/sys/unix/asm_zos_s390x.s +382 -0
- package/govendor/golang.org/x/sys/unix/auxv.go +36 -0
- package/govendor/golang.org/x/sys/unix/auxv_unsupported.go +13 -0
- package/govendor/golang.org/x/sys/unix/bluetooth_linux.go +36 -0
- package/govendor/golang.org/x/sys/unix/bpxsvc_zos.go +657 -0
- package/govendor/golang.org/x/sys/unix/bpxsvc_zos.s +192 -0
- package/govendor/golang.org/x/sys/unix/cap_freebsd.go +195 -0
- package/govendor/golang.org/x/sys/unix/constants.go +13 -0
- package/govendor/golang.org/x/sys/unix/dev_aix_ppc.go +26 -0
- package/govendor/golang.org/x/sys/unix/dev_aix_ppc64.go +28 -0
- package/govendor/golang.org/x/sys/unix/dev_darwin.go +24 -0
- package/govendor/golang.org/x/sys/unix/dev_dragonfly.go +30 -0
- package/govendor/golang.org/x/sys/unix/dev_freebsd.go +30 -0
- package/govendor/golang.org/x/sys/unix/dev_linux.go +42 -0
- package/govendor/golang.org/x/sys/unix/dev_netbsd.go +29 -0
- package/govendor/golang.org/x/sys/unix/dev_openbsd.go +29 -0
- package/govendor/golang.org/x/sys/unix/dev_zos.go +28 -0
- package/govendor/golang.org/x/sys/unix/dirent.go +102 -0
- package/govendor/golang.org/x/sys/unix/endian_big.go +9 -0
- package/govendor/golang.org/x/sys/unix/endian_little.go +9 -0
- package/govendor/golang.org/x/sys/unix/env_unix.go +31 -0
- package/govendor/golang.org/x/sys/unix/fcntl.go +36 -0
- package/govendor/golang.org/x/sys/unix/fcntl_darwin.go +24 -0
- package/govendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +13 -0
- package/govendor/golang.org/x/sys/unix/fdset.go +27 -0
- package/govendor/golang.org/x/sys/unix/gccgo.go +59 -0
- package/govendor/golang.org/x/sys/unix/gccgo_c.c +44 -0
- package/govendor/golang.org/x/sys/unix/gccgo_linux_amd64.go +20 -0
- package/govendor/golang.org/x/sys/unix/ifreq_linux.go +145 -0
- package/govendor/golang.org/x/sys/unix/ioctl_linux.go +341 -0
- package/govendor/golang.org/x/sys/unix/ioctl_signed.go +74 -0
- package/govendor/golang.org/x/sys/unix/ioctl_unsigned.go +74 -0
- package/govendor/golang.org/x/sys/unix/ioctl_zos.go +71 -0
- package/govendor/golang.org/x/sys/unix/mkall.sh +250 -0
- package/govendor/golang.org/x/sys/unix/mkerrors.sh +807 -0
- package/govendor/golang.org/x/sys/unix/mmap_nomremap.go +13 -0
- package/govendor/golang.org/x/sys/unix/mremap.go +57 -0
- package/govendor/golang.org/x/sys/unix/pagesize_unix.go +15 -0
- package/govendor/golang.org/x/sys/unix/pledge_openbsd.go +111 -0
- package/govendor/golang.org/x/sys/unix/ptrace_darwin.go +11 -0
- package/govendor/golang.org/x/sys/unix/ptrace_ios.go +11 -0
- package/govendor/golang.org/x/sys/unix/race.go +30 -0
- package/govendor/golang.org/x/sys/unix/race0.go +25 -0
- package/govendor/golang.org/x/sys/unix/readdirent_getdents.go +12 -0
- package/govendor/golang.org/x/sys/unix/readdirent_getdirentries.go +19 -0
- package/govendor/golang.org/x/sys/unix/readv_unix.go +103 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go +16 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_linux.go +85 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_unix.go +106 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_unix_other.go +46 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_zos.go +58 -0
- package/govendor/golang.org/x/sys/unix/symaddr_zos_s390x.s +75 -0
- package/govendor/golang.org/x/sys/unix/syscall.go +86 -0
- package/govendor/golang.org/x/sys/unix/syscall_aix.go +582 -0
- package/govendor/golang.org/x/sys/unix/syscall_aix_ppc.go +52 -0
- package/govendor/golang.org/x/sys/unix/syscall_aix_ppc64.go +83 -0
- package/govendor/golang.org/x/sys/unix/syscall_bsd.go +609 -0
- package/govendor/golang.org/x/sys/unix/syscall_darwin.go +711 -0
- package/govendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +50 -0
- package/govendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +50 -0
- package/govendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go +26 -0
- package/govendor/golang.org/x/sys/unix/syscall_dragonfly.go +359 -0
- package/govendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +56 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd.go +455 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_386.go +64 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +64 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +60 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +60 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go +60 -0
- package/govendor/golang.org/x/sys/unix/syscall_hurd.go +30 -0
- package/govendor/golang.org/x/sys/unix/syscall_hurd_386.go +28 -0
- package/govendor/golang.org/x/sys/unix/syscall_illumos.go +78 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux.go +2574 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_386.go +313 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_alarm.go +12 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_amd64.go +144 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go +12 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_arm.go +218 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_arm64.go +188 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gc.go +14 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gc_386.go +16 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go +13 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go +30 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +20 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_loong64.go +220 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +187 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +173 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_ppc.go +203 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +114 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +193 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_s390x.go +295 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +111 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd.go +388 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd_386.go +37 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +37 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd_arm.go +37 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +37 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd.go +346 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_386.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_libc.go +26 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go +39 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_solaris.go +1183 -0
- package/govendor/golang.org/x/sys/unix/syscall_solaris_amd64.go +27 -0
- package/govendor/golang.org/x/sys/unix/syscall_unix.go +619 -0
- package/govendor/golang.org/x/sys/unix/syscall_unix_gc.go +14 -0
- package/govendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +22 -0
- package/govendor/golang.org/x/sys/unix/syscall_zos_s390x.go +3213 -0
- package/govendor/golang.org/x/sys/unix/sysvshm_linux.go +20 -0
- package/govendor/golang.org/x/sys/unix/sysvshm_unix.go +51 -0
- package/govendor/golang.org/x/sys/unix/sysvshm_unix_other.go +13 -0
- package/govendor/golang.org/x/sys/unix/timestruct.go +76 -0
- package/govendor/golang.org/x/sys/unix/unveil_openbsd.go +51 -0
- package/govendor/golang.org/x/sys/unix/vgetrandom_linux.go +13 -0
- package/govendor/golang.org/x/sys/unix/vgetrandom_unsupported.go +11 -0
- package/govendor/golang.org/x/sys/unix/xattr_bsd.go +280 -0
- package/govendor/golang.org/x/sys/unix/zerrors_aix_ppc.go +1384 -0
- package/govendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go +1385 -0
- package/govendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +1922 -0
- package/govendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +1922 -0
- package/govendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go +1737 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_386.go +2042 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go +2039 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go +2033 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go +2033 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go +2147 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux.go +4209 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_386.go +882 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +882 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_arm.go +887 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +884 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +874 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_mips.go +888 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +888 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +888 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +888 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +940 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +944 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +944 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +884 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +943 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +992 -0
- package/govendor/golang.org/x/sys/unix/zerrors_netbsd_386.go +1779 -0
- package/govendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go +1769 -0
- package/govendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go +1758 -0
- package/govendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go +1769 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_386.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go +1904 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go +1903 -0
- package/govendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go +1556 -0
- package/govendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +990 -0
- package/govendor/golang.org/x/sys/unix/zptrace_armnn_linux.go +40 -0
- package/govendor/golang.org/x/sys/unix/zptrace_linux_arm64.go +17 -0
- package/govendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go +49 -0
- package/govendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go +49 -0
- package/govendor/golang.org/x/sys/unix/zptrace_x86_linux.go +79 -0
- package/govendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s +364 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +1461 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go +1420 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go +1188 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go +1069 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +2728 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +799 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +2728 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +799 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +1666 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go +101 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux.go +2267 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_386.go +469 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +636 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +584 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +535 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go +469 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +636 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +630 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +619 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +636 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go +641 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +687 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +687 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +531 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +478 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +631 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +1848 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +1848 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +1848 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +1848 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +862 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +2217 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go +3458 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go +281 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go +439 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go +437 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go +316 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_386.go +470 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +394 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +434 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +337 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +334 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +454 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +384 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +384 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +454 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +461 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +433 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +433 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +338 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +399 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +413 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go +274 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go +274 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go +274 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go +274 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go +219 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go +219 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go +219 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go +218 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go +221 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go +217 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go +218 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +2852 -0
- package/govendor/golang.org/x/sys/unix/ztypes_aix_ppc.go +353 -0
- package/govendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go +357 -0
- package/govendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +878 -0
- package/govendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +878 -0
- package/govendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +473 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +651 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +656 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +642 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +636 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go +638 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux.go +6547 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_386.go +747 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +761 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_arm.go +741 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +740 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +741 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_mips.go +746 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +743 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +743 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +746 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +754 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +749 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +749 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +828 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +763 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +744 -0
- package/govendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +585 -0
- package/govendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +593 -0
- package/govendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +590 -0
- package/govendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +593 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +568 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +568 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +575 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +568 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go +568 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go +570 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go +570 -0
- package/govendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +516 -0
- package/govendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +552 -0
- package/govendor/golang.org/x/sys/windows/aliases.go +13 -0
- package/govendor/golang.org/x/sys/windows/dll_windows.go +380 -0
- package/govendor/golang.org/x/sys/windows/env_windows.go +57 -0
- package/govendor/golang.org/x/sys/windows/eventlog.go +20 -0
- package/govendor/golang.org/x/sys/windows/exec_windows.go +248 -0
- package/govendor/golang.org/x/sys/windows/memory_windows.go +48 -0
- package/govendor/golang.org/x/sys/windows/mkerrors.bash +70 -0
- package/govendor/golang.org/x/sys/windows/mkknownfolderids.bash +27 -0
- package/govendor/golang.org/x/sys/windows/mksyscall.go +9 -0
- package/govendor/golang.org/x/sys/windows/race.go +30 -0
- package/govendor/golang.org/x/sys/windows/race0.go +25 -0
- package/govendor/golang.org/x/sys/windows/security_windows.go +1537 -0
- package/govendor/golang.org/x/sys/windows/service.go +257 -0
- package/govendor/golang.org/x/sys/windows/setupapi_windows.go +1425 -0
- package/govendor/golang.org/x/sys/windows/str.go +22 -0
- package/govendor/golang.org/x/sys/windows/syscall.go +104 -0
- package/govendor/golang.org/x/sys/windows/syscall_windows.go +1952 -0
- package/govendor/golang.org/x/sys/windows/types_windows.go +4058 -0
- package/govendor/golang.org/x/sys/windows/types_windows_386.go +35 -0
- package/govendor/golang.org/x/sys/windows/types_windows_amd64.go +34 -0
- package/govendor/golang.org/x/sys/windows/types_windows_arm.go +35 -0
- package/govendor/golang.org/x/sys/windows/types_windows_arm64.go +34 -0
- package/govendor/golang.org/x/sys/windows/zerrors_windows.go +9468 -0
- package/govendor/golang.org/x/sys/windows/zknownfolderids_windows.go +149 -0
- package/govendor/golang.org/x/sys/windows/zsyscall_windows.go +4828 -0
- package/govendor/manifest.txt +7 -0
- package/package.json +7 -1
- package/tsparser/check.go +157 -0
- package/tsparser/main.go +30 -1
- package/types/typenative-go.d.ts +15159 -5
- package/types/typenative-npm.d.ts +2640 -34
- package/types/typenative.d.ts +651 -8
|
@@ -1,53 +1,2659 @@
|
|
|
1
|
-
// Type definitions for
|
|
1
|
+
// Type definitions for the Node.js standard library modules TypeNative lowers
|
|
2
|
+
// to Go (see conformance.md for the feature matrix). Signatures follow
|
|
3
|
+
// @types/node; only what the transpiler implements is declared.
|
|
4
|
+
// `readline.question()` is a TypeNative extension (synchronous line input).
|
|
5
|
+
//
|
|
6
|
+
// Each module uses `export =` so named, default and namespace imports all work;
|
|
7
|
+
// bare specifiers ('fs') and subpaths ('fs/promises') re-export the `node:` ones.
|
|
2
8
|
|
|
3
9
|
declare module 'node:path' {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
namespace path {
|
|
11
|
+
interface ParsedPath {
|
|
12
|
+
root: string;
|
|
13
|
+
dir: string;
|
|
14
|
+
base: string;
|
|
15
|
+
ext: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
interface FormatInputPathObject {
|
|
19
|
+
root?: string;
|
|
20
|
+
dir?: string;
|
|
21
|
+
base?: string;
|
|
22
|
+
ext?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
}
|
|
25
|
+
interface PlatformPath {
|
|
26
|
+
readonly sep: '\\' | '/';
|
|
27
|
+
readonly delimiter: ';' | ':';
|
|
28
|
+
join(...paths: string[]): string;
|
|
29
|
+
resolve(...paths: string[]): string;
|
|
30
|
+
normalize(path: string): string;
|
|
31
|
+
relative(from: string, to: string): string;
|
|
32
|
+
dirname(path: string): string;
|
|
33
|
+
basename(path: string, suffix?: string): string;
|
|
34
|
+
extname(path: string): string;
|
|
35
|
+
isAbsolute(path: string): boolean;
|
|
36
|
+
parse(path: string): ParsedPath;
|
|
37
|
+
format(pathObject: FormatInputPathObject): string;
|
|
38
|
+
toNamespacedPath(path: string): string;
|
|
39
|
+
matchesGlob(path: string, pattern: string): boolean;
|
|
40
|
+
readonly posix: PlatformPath;
|
|
41
|
+
readonly win32: PlatformPath;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const path: path.PlatformPath;
|
|
45
|
+
export = path;
|
|
46
|
+
}
|
|
47
|
+
declare module 'node:path/posix' {
|
|
48
|
+
import path = require('node:path');
|
|
49
|
+
const posix: path.PlatformPath;
|
|
50
|
+
export = posix;
|
|
51
|
+
}
|
|
52
|
+
declare module 'node:path/win32' {
|
|
53
|
+
import path = require('node:path');
|
|
54
|
+
const win32: path.PlatformPath;
|
|
55
|
+
export = win32;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare module 'node:buffer' {
|
|
59
|
+
namespace buffer {
|
|
60
|
+
const Buffer: BufferConstructor;
|
|
61
|
+
type Buffer = globalThis.Buffer;
|
|
62
|
+
function atob(data: string): string;
|
|
63
|
+
function btoa(data: string): string;
|
|
64
|
+
const constants: { readonly MAX_LENGTH: number; readonly MAX_STRING_LENGTH: number };
|
|
65
|
+
const kMaxLength: number;
|
|
66
|
+
const kStringMaxLength: number;
|
|
67
|
+
function isUtf8(input: Uint8Array): boolean;
|
|
68
|
+
function isAscii(input: Uint8Array): boolean;
|
|
69
|
+
function transcode(source: Uint8Array, fromEnc: BufferEncoding, toEnc: BufferEncoding): Buffer;
|
|
70
|
+
const Blob: typeof globalThis.Blob;
|
|
71
|
+
type Blob = globalThis.Blob;
|
|
72
|
+
const File: typeof globalThis.File;
|
|
73
|
+
type File = globalThis.File;
|
|
74
|
+
}
|
|
75
|
+
export = buffer;
|
|
9
76
|
}
|
|
10
77
|
|
|
11
78
|
declare module 'node:fs' {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
79
|
+
import { Readable, Writable } from 'node:stream';
|
|
80
|
+
namespace fs {
|
|
81
|
+
type PathLike = string;
|
|
82
|
+
type EncodingOption = BufferEncoding | { encoding?: BufferEncoding | null; flag?: string } | null;
|
|
83
|
+
interface StatsBase {
|
|
84
|
+
isFile(): boolean;
|
|
85
|
+
isDirectory(): boolean;
|
|
86
|
+
isSymbolicLink(): boolean;
|
|
87
|
+
isFIFO(): boolean;
|
|
88
|
+
isSocket(): boolean;
|
|
89
|
+
isBlockDevice(): boolean;
|
|
90
|
+
isCharacterDevice(): boolean;
|
|
91
|
+
}
|
|
92
|
+
interface Stats extends StatsBase {
|
|
93
|
+
dev: number;
|
|
94
|
+
ino: number;
|
|
95
|
+
mode: number;
|
|
96
|
+
nlink: number;
|
|
97
|
+
uid: number;
|
|
98
|
+
gid: number;
|
|
99
|
+
rdev: number;
|
|
100
|
+
size: number;
|
|
101
|
+
blksize: number;
|
|
102
|
+
blocks: number;
|
|
103
|
+
atimeMs: number;
|
|
104
|
+
mtimeMs: number;
|
|
105
|
+
ctimeMs: number;
|
|
106
|
+
birthtimeMs: number;
|
|
107
|
+
atime: Date;
|
|
108
|
+
mtime: Date;
|
|
109
|
+
ctime: Date;
|
|
110
|
+
birthtime: Date;
|
|
111
|
+
}
|
|
112
|
+
interface Dirent extends StatsBase {
|
|
113
|
+
name: string;
|
|
114
|
+
parentPath: string;
|
|
115
|
+
path: string;
|
|
116
|
+
}
|
|
117
|
+
interface WriteFileOptions {
|
|
118
|
+
encoding?: BufferEncoding | null;
|
|
119
|
+
flag?: string;
|
|
120
|
+
mode?: number;
|
|
121
|
+
}
|
|
122
|
+
interface MakeDirectoryOptions {
|
|
123
|
+
recursive?: boolean;
|
|
124
|
+
mode?: number;
|
|
125
|
+
}
|
|
126
|
+
interface RmOptions {
|
|
127
|
+
recursive?: boolean;
|
|
128
|
+
force?: boolean;
|
|
129
|
+
}
|
|
130
|
+
interface ReadStream extends Readable {
|
|
131
|
+
readonly path: string;
|
|
132
|
+
readonly bytesRead: number;
|
|
133
|
+
}
|
|
134
|
+
interface WriteStream extends Writable {
|
|
135
|
+
readonly path: string;
|
|
136
|
+
readonly bytesWritten: number;
|
|
137
|
+
}
|
|
138
|
+
type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
|
|
139
|
+
|
|
140
|
+
const constants: {
|
|
141
|
+
readonly F_OK: number;
|
|
142
|
+
readonly R_OK: number;
|
|
143
|
+
readonly W_OK: number;
|
|
144
|
+
readonly X_OK: number;
|
|
145
|
+
readonly COPYFILE_EXCL: number;
|
|
146
|
+
readonly COPYFILE_FICLONE: number;
|
|
147
|
+
readonly COPYFILE_FICLONE_FORCE: number;
|
|
148
|
+
readonly O_RDONLY: number;
|
|
149
|
+
readonly O_WRONLY: number;
|
|
150
|
+
readonly O_RDWR: number;
|
|
151
|
+
readonly S_IFMT: number;
|
|
152
|
+
readonly S_IFREG: number;
|
|
153
|
+
readonly S_IFDIR: number;
|
|
154
|
+
readonly S_IFLNK: number;
|
|
155
|
+
};
|
|
156
|
+
const F_OK: number;
|
|
157
|
+
const R_OK: number;
|
|
158
|
+
const W_OK: number;
|
|
159
|
+
const X_OK: number;
|
|
160
|
+
|
|
161
|
+
// --- sync ---
|
|
162
|
+
function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string } | null): Buffer;
|
|
163
|
+
function readFileSync(path: PathLike | number, options: BufferEncoding | { encoding: BufferEncoding; flag?: string }): string;
|
|
164
|
+
function writeFileSync(file: PathLike | number, data: string | Uint8Array, options?: WriteFileOptions | BufferEncoding): void;
|
|
165
|
+
function appendFileSync(file: PathLike | number, data: string | Uint8Array, options?: WriteFileOptions | BufferEncoding): void;
|
|
166
|
+
function existsSync(path: PathLike): boolean;
|
|
167
|
+
function mkdirSync(path: PathLike, options?: MakeDirectoryOptions | number): string | undefined;
|
|
168
|
+
function readdirSync(path: PathLike, options?: BufferEncoding | { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean }): string[];
|
|
169
|
+
function readdirSync(path: PathLike, options: { withFileTypes: true; recursive?: boolean }): Dirent[];
|
|
170
|
+
function statSync(path: PathLike, options?: { throwIfNoEntry?: true }): Stats;
|
|
171
|
+
function statSync(path: PathLike, options: { throwIfNoEntry: false }): Stats | undefined;
|
|
172
|
+
function lstatSync(path: PathLike, options?: { throwIfNoEntry?: true }): Stats;
|
|
173
|
+
function lstatSync(path: PathLike, options: { throwIfNoEntry: false }): Stats | undefined;
|
|
174
|
+
function fstatSync(fd: number): Stats;
|
|
175
|
+
function renameSync(oldPath: PathLike, newPath: PathLike): void;
|
|
176
|
+
function rmSync(path: PathLike, options?: RmOptions): void;
|
|
177
|
+
function rmdirSync(path: PathLike, options?: { recursive?: boolean }): void;
|
|
178
|
+
function unlinkSync(path: PathLike): void;
|
|
179
|
+
function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
|
|
180
|
+
function cpSync(source: string, destination: string, options?: { recursive?: boolean; force?: boolean }): void;
|
|
181
|
+
function realpathSync(path: PathLike): string;
|
|
182
|
+
namespace realpathSync {
|
|
183
|
+
function native(path: PathLike): string;
|
|
184
|
+
}
|
|
185
|
+
function mkdtempSync(prefix: string): string;
|
|
186
|
+
function truncateSync(path: PathLike, len?: number): void;
|
|
187
|
+
function chmodSync(path: PathLike, mode: number | string): void;
|
|
188
|
+
function utimesSync(path: PathLike, atime: number | string | Date, mtime: number | string | Date): void;
|
|
189
|
+
function symlinkSync(target: PathLike, path: PathLike, type?: string): void;
|
|
190
|
+
function readlinkSync(path: PathLike): string;
|
|
191
|
+
function linkSync(existingPath: PathLike, newPath: PathLike): void;
|
|
192
|
+
function accessSync(path: PathLike, mode?: number): void;
|
|
193
|
+
function openSync(path: PathLike, flags?: string, mode?: number | string): number;
|
|
194
|
+
function closeSync(fd: number): void;
|
|
195
|
+
function readSync(fd: number, buffer: Uint8Array, offset?: number, length?: number, position?: number | null): number;
|
|
196
|
+
function writeSync(fd: number, buffer: Uint8Array, offset?: number, length?: number, position?: number | null): number;
|
|
197
|
+
function writeSync(fd: number, string: string, position?: number | null): number;
|
|
198
|
+
function fsyncSync(fd: number): void;
|
|
199
|
+
function ftruncateSync(fd: number, len?: number): void;
|
|
200
|
+
|
|
201
|
+
// --- callbacks: work on a goroutine, the callback on the event loop ---
|
|
202
|
+
function readFile(path: PathLike, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
|
|
203
|
+
function readFile(path: PathLike, options: { encoding?: null; flag?: string } | null | undefined, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
|
|
204
|
+
function readFile(path: PathLike, options: BufferEncoding | { encoding: BufferEncoding; flag?: string }, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void;
|
|
205
|
+
function writeFile(file: PathLike, data: string | Uint8Array, callback: NoParamCallback): void;
|
|
206
|
+
function writeFile(file: PathLike, data: string | Uint8Array, options: WriteFileOptions | BufferEncoding, callback: NoParamCallback): void;
|
|
207
|
+
function appendFile(file: PathLike, data: string | Uint8Array, callback: NoParamCallback): void;
|
|
208
|
+
function appendFile(file: PathLike, data: string | Uint8Array, options: WriteFileOptions | BufferEncoding, callback: NoParamCallback): void;
|
|
209
|
+
function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
|
|
210
|
+
function mkdir(path: PathLike, options: MakeDirectoryOptions | number, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
|
|
211
|
+
function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
|
|
212
|
+
function readdir(path: PathLike, options: { withFileTypes?: false; recursive?: boolean } | BufferEncoding, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
|
|
213
|
+
function readdir(path: PathLike, options: { withFileTypes: true; recursive?: boolean }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void;
|
|
214
|
+
function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
215
|
+
function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
216
|
+
function unlink(path: PathLike, callback: NoParamCallback): void;
|
|
217
|
+
function rm(path: PathLike, callback: NoParamCallback): void;
|
|
218
|
+
function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
|
|
219
|
+
function rmdir(path: PathLike, callback: NoParamCallback): void;
|
|
220
|
+
function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
|
|
221
|
+
function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
|
|
222
|
+
function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
|
|
223
|
+
function cp(source: string, destination: string, options: { recursive?: boolean; force?: boolean }, callback: NoParamCallback): void;
|
|
224
|
+
function access(path: PathLike, callback: NoParamCallback): void;
|
|
225
|
+
function access(path: PathLike, mode: number, callback: NoParamCallback): void;
|
|
226
|
+
function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
|
|
227
|
+
function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
|
|
228
|
+
function truncate(path: PathLike, len: number, callback: NoParamCallback): void;
|
|
229
|
+
function chmod(path: PathLike, mode: number | string, callback: NoParamCallback): void;
|
|
230
|
+
function utimes(path: PathLike, atime: number | string | Date, mtime: number | string | Date, callback: NoParamCallback): void;
|
|
231
|
+
function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
|
|
232
|
+
function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
|
|
233
|
+
function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
|
|
234
|
+
/** @deprecated */
|
|
235
|
+
function exists(path: PathLike, callback: (exists: boolean) => void): void;
|
|
236
|
+
|
|
237
|
+
// --- streams ---
|
|
238
|
+
function createReadStream(path: PathLike, options?: BufferEncoding | { encoding?: BufferEncoding; start?: number; end?: number; highWaterMark?: number }): ReadStream;
|
|
239
|
+
function createWriteStream(path: PathLike, options?: BufferEncoding | { flags?: string; encoding?: BufferEncoding }): WriteStream;
|
|
240
|
+
|
|
241
|
+
const promises: typeof import('node:fs/promises');
|
|
242
|
+
}
|
|
243
|
+
export = fs;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
declare module 'node:fs/promises' {
|
|
247
|
+
import fs = require('node:fs');
|
|
248
|
+
namespace promises {
|
|
249
|
+
interface FileHandle {
|
|
250
|
+
readonly fd: number;
|
|
251
|
+
readFile(options?: { encoding?: null } | null): Promise<Buffer>;
|
|
252
|
+
readFile(options: BufferEncoding | { encoding: BufferEncoding }): Promise<string>;
|
|
253
|
+
writeFile(data: string | Uint8Array, options?: fs.WriteFileOptions | BufferEncoding): Promise<void>;
|
|
254
|
+
appendFile(data: string | Uint8Array, options?: fs.WriteFileOptions | BufferEncoding): Promise<void>;
|
|
255
|
+
read(buffer: Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesRead: number; buffer: Buffer }>;
|
|
256
|
+
write(data: string | Uint8Array, ...args: any[]): Promise<{ bytesWritten: number; buffer: any }>;
|
|
257
|
+
stat(): Promise<fs.Stats>;
|
|
258
|
+
truncate(len?: number): Promise<void>;
|
|
259
|
+
sync(): Promise<void>;
|
|
260
|
+
close(): Promise<void>;
|
|
261
|
+
}
|
|
262
|
+
const constants: typeof fs.constants;
|
|
263
|
+
function readFile(path: fs.PathLike, options?: { encoding?: null; flag?: string } | null): Promise<Buffer>;
|
|
264
|
+
function readFile(path: fs.PathLike, options: BufferEncoding | { encoding: BufferEncoding; flag?: string }): Promise<string>;
|
|
265
|
+
function writeFile(file: fs.PathLike, data: string | Uint8Array, options?: fs.WriteFileOptions | BufferEncoding): Promise<void>;
|
|
266
|
+
function appendFile(file: fs.PathLike, data: string | Uint8Array, options?: fs.WriteFileOptions | BufferEncoding): Promise<void>;
|
|
267
|
+
function mkdir(path: fs.PathLike, options?: fs.MakeDirectoryOptions | number): Promise<string | undefined>;
|
|
268
|
+
function readdir(path: fs.PathLike, options?: BufferEncoding | { withFileTypes?: false; recursive?: boolean }): Promise<string[]>;
|
|
269
|
+
function readdir(path: fs.PathLike, options: { withFileTypes: true; recursive?: boolean }): Promise<fs.Dirent[]>;
|
|
270
|
+
function stat(path: fs.PathLike): Promise<fs.Stats>;
|
|
271
|
+
function lstat(path: fs.PathLike): Promise<fs.Stats>;
|
|
272
|
+
function unlink(path: fs.PathLike): Promise<void>;
|
|
273
|
+
function rm(path: fs.PathLike, options?: fs.RmOptions): Promise<void>;
|
|
274
|
+
function rmdir(path: fs.PathLike, options?: { recursive?: boolean }): Promise<void>;
|
|
275
|
+
function rename(oldPath: fs.PathLike, newPath: fs.PathLike): Promise<void>;
|
|
276
|
+
function copyFile(src: fs.PathLike, dest: fs.PathLike, mode?: number): Promise<void>;
|
|
277
|
+
function cp(source: string, destination: string, options?: { recursive?: boolean; force?: boolean }): Promise<void>;
|
|
278
|
+
function access(path: fs.PathLike, mode?: number): Promise<void>;
|
|
279
|
+
function realpath(path: fs.PathLike): Promise<string>;
|
|
280
|
+
function mkdtemp(prefix: string): Promise<string>;
|
|
281
|
+
function truncate(path: fs.PathLike, len?: number): Promise<void>;
|
|
282
|
+
function chmod(path: fs.PathLike, mode: number | string): Promise<void>;
|
|
283
|
+
function utimes(path: fs.PathLike, atime: number | string | Date, mtime: number | string | Date): Promise<void>;
|
|
284
|
+
function symlink(target: fs.PathLike, path: fs.PathLike): Promise<void>;
|
|
285
|
+
function readlink(path: fs.PathLike): Promise<string>;
|
|
286
|
+
function link(existingPath: fs.PathLike, newPath: fs.PathLike): Promise<void>;
|
|
287
|
+
function open(path: fs.PathLike, flags?: string, mode?: number | string): Promise<FileHandle>;
|
|
288
|
+
}
|
|
289
|
+
export = promises;
|
|
21
290
|
}
|
|
22
291
|
|
|
23
292
|
declare module 'node:url' {
|
|
24
|
-
|
|
25
|
-
|
|
293
|
+
namespace url {
|
|
294
|
+
const URL: typeof globalThis.URL;
|
|
295
|
+
type URL = globalThis.URL;
|
|
296
|
+
const URLSearchParams: typeof globalThis.URLSearchParams;
|
|
297
|
+
type URLSearchParams = globalThis.URLSearchParams;
|
|
298
|
+
function fileURLToPath(url: string | URL): string;
|
|
299
|
+
function pathToFileURL(path: string): URL;
|
|
300
|
+
function format(url: URL | string): string;
|
|
301
|
+
function domainToASCII(domain: string): string;
|
|
302
|
+
function domainToUnicode(domain: string): string;
|
|
303
|
+
}
|
|
304
|
+
export = url;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
declare module 'node:querystring' {
|
|
308
|
+
namespace querystring {
|
|
309
|
+
interface ParsedUrlQuery {
|
|
310
|
+
[key: string]: string | string[] | undefined;
|
|
311
|
+
}
|
|
312
|
+
type ParsedUrlQueryInput = { [key: string]: string | number | boolean | bigint | readonly (string | number | boolean | bigint)[] | null | undefined };
|
|
313
|
+
function parse(str: string, sep?: string, eq?: string): ParsedUrlQuery;
|
|
314
|
+
function decode(str: string, sep?: string, eq?: string): ParsedUrlQuery;
|
|
315
|
+
function stringify(obj: ParsedUrlQueryInput, sep?: string, eq?: string): string;
|
|
316
|
+
function encode(obj: ParsedUrlQueryInput, sep?: string, eq?: string): string;
|
|
317
|
+
function escape(str: string): string;
|
|
318
|
+
function unescape(str: string): string;
|
|
319
|
+
}
|
|
320
|
+
export = querystring;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
declare module 'node:punycode' {
|
|
324
|
+
/** @deprecated punycode is deprecated upstream */
|
|
325
|
+
namespace punycode {
|
|
326
|
+
function encode(input: string): string;
|
|
327
|
+
function decode(input: string): string;
|
|
328
|
+
function toASCII(domain: string): string;
|
|
329
|
+
function toUnicode(domain: string): string;
|
|
330
|
+
const version: string;
|
|
331
|
+
}
|
|
332
|
+
export = punycode;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
declare module 'node:string_decoder' {
|
|
336
|
+
namespace string_decoder {
|
|
337
|
+
class StringDecoder {
|
|
338
|
+
constructor(encoding?: BufferEncoding);
|
|
339
|
+
readonly encoding: BufferEncoding;
|
|
340
|
+
write(buffer: string | Uint8Array): string;
|
|
341
|
+
end(buffer?: string | Uint8Array): string;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
export = string_decoder;
|
|
26
345
|
}
|
|
27
346
|
|
|
28
347
|
declare module 'node:os' {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
348
|
+
namespace os {
|
|
349
|
+
interface UserInfo {
|
|
350
|
+
username: string;
|
|
351
|
+
uid: number;
|
|
352
|
+
gid: number;
|
|
353
|
+
shell: string | null;
|
|
354
|
+
homedir: string;
|
|
355
|
+
}
|
|
356
|
+
interface CpuInfo {
|
|
357
|
+
model: string;
|
|
358
|
+
speed: number;
|
|
359
|
+
times: { user: number; nice: number; sys: number; idle: number; irq: number };
|
|
360
|
+
}
|
|
361
|
+
interface NetworkInterfaceInfo {
|
|
362
|
+
address: string;
|
|
363
|
+
netmask: string;
|
|
364
|
+
family: 'IPv4' | 'IPv6';
|
|
365
|
+
mac: string;
|
|
366
|
+
internal: boolean;
|
|
367
|
+
cidr: string | null;
|
|
368
|
+
scopeid?: number;
|
|
369
|
+
}
|
|
370
|
+
const EOL: string;
|
|
371
|
+
const devNull: string;
|
|
372
|
+
const constants: { readonly signals: { readonly [name: string]: number; readonly SIGINT: number; readonly SIGTERM: number; readonly SIGKILL: number; readonly SIGHUP: number } };
|
|
373
|
+
function platform(): string;
|
|
374
|
+
function arch(): string;
|
|
375
|
+
function type(): string;
|
|
376
|
+
function machine(): string;
|
|
377
|
+
function hostname(): string;
|
|
378
|
+
function homedir(): string;
|
|
379
|
+
function tmpdir(): string;
|
|
380
|
+
function endianness(): 'BE' | 'LE';
|
|
381
|
+
function userInfo(): UserInfo;
|
|
382
|
+
function cpus(): CpuInfo[];
|
|
383
|
+
function availableParallelism(): number;
|
|
384
|
+
function networkInterfaces(): Record<string, NetworkInterfaceInfo[]>;
|
|
385
|
+
function totalmem(): number;
|
|
386
|
+
function freemem(): number;
|
|
387
|
+
function uptime(): number;
|
|
388
|
+
function loadavg(): number[];
|
|
389
|
+
function release(): string;
|
|
390
|
+
function version(): string;
|
|
391
|
+
}
|
|
392
|
+
export = os;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
declare module 'node:process' {
|
|
396
|
+
const process: Process;
|
|
397
|
+
export = process;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
declare module 'node:console' {
|
|
401
|
+
namespace console {
|
|
402
|
+
class Console {
|
|
403
|
+
constructor(stdout: import('node:stream').Writable, stderr?: import('node:stream').Writable);
|
|
404
|
+
constructor(options: { stdout: import('node:stream').Writable; stderr?: import('node:stream').Writable });
|
|
405
|
+
log(...data: any[]): void;
|
|
406
|
+
info(...data: any[]): void;
|
|
407
|
+
debug(...data: any[]): void;
|
|
408
|
+
error(...data: any[]): void;
|
|
409
|
+
warn(...data: any[]): void;
|
|
410
|
+
dir(item: any, options?: { depth?: number | null }): void;
|
|
411
|
+
}
|
|
412
|
+
function log(...data: any[]): void;
|
|
413
|
+
function info(...data: any[]): void;
|
|
414
|
+
function debug(...data: any[]): void;
|
|
415
|
+
function error(...data: any[]): void;
|
|
416
|
+
function warn(...data: any[]): void;
|
|
417
|
+
function dir(item: any, options?: { depth?: number | null }): void;
|
|
418
|
+
function count(label?: string): void;
|
|
419
|
+
function countReset(label?: string): void;
|
|
420
|
+
function group(...label: any[]): void;
|
|
421
|
+
function groupEnd(): void;
|
|
422
|
+
function time(label?: string): void;
|
|
423
|
+
function timeEnd(label?: string): void;
|
|
424
|
+
function timeLog(label?: string, ...data: any[]): void;
|
|
425
|
+
function trace(...data: any[]): void;
|
|
426
|
+
function assert(condition?: boolean, ...data: any[]): void;
|
|
427
|
+
}
|
|
428
|
+
export = console;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
declare module 'node:util' {
|
|
432
|
+
namespace util {
|
|
433
|
+
interface InspectOptions {
|
|
434
|
+
depth?: number | null;
|
|
435
|
+
breakLength?: number;
|
|
436
|
+
compact?: boolean | number;
|
|
437
|
+
}
|
|
438
|
+
function format(format?: any, ...param: any[]): string;
|
|
439
|
+
function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
|
|
440
|
+
function inspect(object: any, options?: InspectOptions): string;
|
|
441
|
+
function isDeepStrictEqual(val1: unknown, val2: unknown): boolean;
|
|
442
|
+
function deprecate<T extends (...args: any[]) => any>(fn: T, msg: string, code?: string): T;
|
|
443
|
+
function stripVTControlCharacters(str: string): string;
|
|
444
|
+
function styleText(format: string | string[], text: string, options?: { validateStream?: boolean }): string;
|
|
445
|
+
/** @deprecated */
|
|
446
|
+
function isArray(object: unknown): object is unknown[];
|
|
447
|
+
// Node callback functions map to their promise variants (fs.readFile → fs/promises.readFile,
|
|
448
|
+
// exec → { stdout, stderr }); other (…args, (err, value) => void) functions are wrapped
|
|
449
|
+
function promisify(fn: typeof import('node:child_process').exec): (command: string, options?: { cwd?: string; env?: Record<string, string | undefined> }) => Promise<{ stdout: string; stderr: string }>;
|
|
450
|
+
function promisify(fn: typeof import('node:child_process').execFile): (file: string, args?: readonly string[], options?: { cwd?: string }) => Promise<{ stdout: string; stderr: string }>;
|
|
451
|
+
function promisify(fn: typeof globalThis.setTimeout): <T = void>(ms?: number, value?: T) => Promise<T>;
|
|
452
|
+
function promisify(fn: typeof import('node:fs').readFile): typeof import('node:fs/promises').readFile;
|
|
453
|
+
function promisify(fn: typeof import('node:fs').writeFile): typeof import('node:fs/promises').writeFile;
|
|
454
|
+
function promisify<TCustom extends Function>(fn: { __promisify__: TCustom }): TCustom;
|
|
455
|
+
function promisify<T, A extends any[]>(fn: (...args: [...A, (err: any, result?: T) => void]) => void): (...args: A) => Promise<T>;
|
|
456
|
+
function promisify(fn: Function): (...args: any[]) => Promise<any>;
|
|
457
|
+
function callbackify<T, A extends any[]>(fn: (...args: A) => Promise<T>): (...args: [...A, (err: unknown, result: T) => void]) => void;
|
|
458
|
+
const types: typeof import('node:util/types');
|
|
459
|
+
interface ParseArgsOptionConfig {
|
|
460
|
+
type: 'string' | 'boolean';
|
|
461
|
+
short?: string;
|
|
462
|
+
multiple?: boolean;
|
|
463
|
+
default?: string | boolean | string[] | boolean[];
|
|
464
|
+
}
|
|
465
|
+
interface ParseArgsConfig {
|
|
466
|
+
args?: string[];
|
|
467
|
+
options?: Record<string, ParseArgsOptionConfig>;
|
|
468
|
+
strict?: boolean;
|
|
469
|
+
allowPositionals?: boolean;
|
|
470
|
+
allowNegative?: boolean;
|
|
471
|
+
tokens?: boolean;
|
|
472
|
+
}
|
|
473
|
+
interface ParseArgsToken {
|
|
474
|
+
kind: 'option' | 'positional' | 'option-terminator';
|
|
475
|
+
index: number;
|
|
476
|
+
name?: string;
|
|
477
|
+
rawName?: string;
|
|
478
|
+
value?: string;
|
|
479
|
+
inlineValue?: boolean;
|
|
480
|
+
}
|
|
481
|
+
function parseArgs(config?: ParseArgsConfig): {
|
|
482
|
+
values: Record<string, string | boolean | (string | boolean)[] | undefined>;
|
|
483
|
+
positionals: string[];
|
|
484
|
+
tokens?: ParseArgsToken[];
|
|
485
|
+
};
|
|
486
|
+
function getSystemErrorName(err: number): string;
|
|
487
|
+
function getSystemErrorMessage(err: number): string;
|
|
488
|
+
function getSystemErrorMap(): Map<number, [string, string]>;
|
|
489
|
+
function parseEnv(content: string): Record<string, string>;
|
|
490
|
+
function aborted(signal: AbortSignal, resource: any): Promise<void>;
|
|
491
|
+
function debuglog(section: string, callback?: (fn: (msg: string, ...param: any[]) => void) => void): (msg: string, ...param: any[]) => void;
|
|
492
|
+
const debug: typeof debuglog;
|
|
493
|
+
function toUSVString(string: string): string;
|
|
494
|
+
class MIMEType {
|
|
495
|
+
constructor(input: string | { toString: () => string });
|
|
496
|
+
type: string;
|
|
497
|
+
subtype: string;
|
|
498
|
+
readonly essence: string;
|
|
499
|
+
readonly params: MIMEParams;
|
|
500
|
+
toString(): string;
|
|
501
|
+
toJSON(): string;
|
|
502
|
+
}
|
|
503
|
+
class MIMEParams {
|
|
504
|
+
get(name: string): string | null;
|
|
505
|
+
has(name: string): boolean;
|
|
506
|
+
set(name: string, value: string): void;
|
|
507
|
+
delete(name: string): void;
|
|
508
|
+
keys(): IterableIterator<string>;
|
|
509
|
+
values(): IterableIterator<string>;
|
|
510
|
+
entries(): IterableIterator<[string, string]>;
|
|
511
|
+
toString(): string;
|
|
512
|
+
[Symbol.iterator](): Iterator<[string, string]>;
|
|
513
|
+
}
|
|
514
|
+
const TextEncoder: typeof globalThis.TextEncoder;
|
|
515
|
+
const TextDecoder: typeof globalThis.TextDecoder;
|
|
516
|
+
}
|
|
517
|
+
export = util;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
declare module 'node:util/types' {
|
|
521
|
+
namespace types {
|
|
522
|
+
function isDate(object: unknown): object is Date;
|
|
523
|
+
function isRegExp(object: unknown): object is RegExp;
|
|
524
|
+
function isPromise(object: unknown): object is Promise<unknown>;
|
|
525
|
+
function isMap(object: unknown): object is Map<unknown, unknown>;
|
|
526
|
+
function isSet(object: unknown): object is Set<unknown>;
|
|
527
|
+
function isNativeError(object: unknown): object is Error;
|
|
528
|
+
function isUint8Array(object: unknown): object is Uint8Array;
|
|
529
|
+
function isAnyArrayBuffer(object: unknown): boolean;
|
|
530
|
+
function isBoxedPrimitive(object: unknown): boolean;
|
|
531
|
+
function isGeneratorObject(object: unknown): boolean;
|
|
532
|
+
function isAsyncFunction(object: unknown): boolean;
|
|
533
|
+
}
|
|
534
|
+
export = types;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
declare module 'node:assert' {
|
|
538
|
+
function assert(value: unknown, message?: string | Error): asserts value;
|
|
539
|
+
namespace assert {
|
|
540
|
+
class AssertionError extends Error {
|
|
541
|
+
actual: unknown;
|
|
542
|
+
expected: unknown;
|
|
543
|
+
operator: string;
|
|
544
|
+
generatedMessage: boolean;
|
|
545
|
+
code: 'ERR_ASSERTION';
|
|
546
|
+
}
|
|
547
|
+
type ErrorValidator = RegExp | Function | { message?: string | RegExp; code?: string; name?: string } | ((err: any) => boolean);
|
|
548
|
+
function ok(value: unknown, message?: string | Error): asserts value;
|
|
549
|
+
function equal(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
550
|
+
function notEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
551
|
+
function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
|
|
552
|
+
function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
553
|
+
function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
554
|
+
function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
555
|
+
function deepStrictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
|
|
556
|
+
function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
557
|
+
function throws(block: () => unknown, message?: string | Error): void;
|
|
558
|
+
function throws(block: () => unknown, error: ErrorValidator, message?: string | Error): void;
|
|
559
|
+
function doesNotThrow(block: () => unknown, message?: string | Error): void;
|
|
560
|
+
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
|
561
|
+
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: ErrorValidator, message?: string | Error): Promise<void>;
|
|
562
|
+
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
|
563
|
+
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
|
564
|
+
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
|
565
|
+
function fail(message?: string | Error): never;
|
|
566
|
+
function ifError(value: unknown): asserts value is null | undefined;
|
|
567
|
+
const strict: typeof assert;
|
|
568
|
+
}
|
|
569
|
+
export = assert;
|
|
570
|
+
}
|
|
571
|
+
declare module 'node:assert/strict' {
|
|
572
|
+
import assert = require('node:assert');
|
|
573
|
+
export = assert;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
declare module 'node:crypto' {
|
|
577
|
+
namespace crypto {
|
|
578
|
+
type BinaryLike = string | Uint8Array;
|
|
579
|
+
type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary';
|
|
580
|
+
interface Hash {
|
|
581
|
+
update(data: BinaryLike, inputEncoding?: BufferEncoding): Hash;
|
|
582
|
+
digest(): Buffer;
|
|
583
|
+
digest(encoding: BinaryToTextEncoding | BufferEncoding): string;
|
|
584
|
+
copy(): Hash;
|
|
585
|
+
}
|
|
586
|
+
interface Hmac {
|
|
587
|
+
update(data: BinaryLike, inputEncoding?: BufferEncoding): Hmac;
|
|
588
|
+
digest(): Buffer;
|
|
589
|
+
digest(encoding: BinaryToTextEncoding | BufferEncoding): string;
|
|
590
|
+
}
|
|
591
|
+
interface Cipheriv {
|
|
592
|
+
update(data: BinaryLike): Buffer;
|
|
593
|
+
update(data: string, inputEncoding: BufferEncoding | undefined, outputEncoding: BufferEncoding): string;
|
|
594
|
+
final(): Buffer;
|
|
595
|
+
final(outputEncoding: BufferEncoding): string;
|
|
596
|
+
setAAD(buffer: Uint8Array, options?: { plaintextLength: number }): this;
|
|
597
|
+
getAuthTag(): Buffer;
|
|
598
|
+
setAutoPadding(autoPadding?: boolean): this;
|
|
599
|
+
}
|
|
600
|
+
interface Decipheriv {
|
|
601
|
+
update(data: Uint8Array): Buffer;
|
|
602
|
+
update(data: string, inputEncoding: BufferEncoding, outputEncoding: BufferEncoding): string;
|
|
603
|
+
final(): Buffer;
|
|
604
|
+
final(outputEncoding: BufferEncoding): string;
|
|
605
|
+
setAAD(buffer: Uint8Array, options?: { plaintextLength: number }): this;
|
|
606
|
+
setAuthTag(buffer: Uint8Array): this;
|
|
607
|
+
setAutoPadding(autoPadding?: boolean): this;
|
|
608
|
+
}
|
|
609
|
+
function createHash(algorithm: string): Hash;
|
|
610
|
+
function createHmac(algorithm: string, key: BinaryLike): Hmac;
|
|
611
|
+
function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string;
|
|
612
|
+
function getHashes(): string[];
|
|
613
|
+
function getCiphers(): string[];
|
|
614
|
+
function randomBytes(size: number): Buffer;
|
|
615
|
+
function randomUUID(): string;
|
|
616
|
+
function randomInt(max: number): number;
|
|
617
|
+
function randomInt(min: number, max: number): number;
|
|
618
|
+
function getRandomValues<T extends Uint8Array>(typedArray: T): T;
|
|
619
|
+
function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean;
|
|
620
|
+
function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer;
|
|
621
|
+
function hkdfSync(digest: string, ikm: BinaryLike, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer;
|
|
622
|
+
function createCipheriv(algorithm: string, key: BinaryLike, iv: BinaryLike): Cipheriv;
|
|
623
|
+
function createDecipheriv(algorithm: string, key: BinaryLike, iv: BinaryLike): Decipheriv;
|
|
624
|
+
const webcrypto: typeof crypto;
|
|
625
|
+
|
|
626
|
+
// scrypt, callback forms
|
|
627
|
+
interface ScryptOptions {
|
|
628
|
+
cost?: number;
|
|
629
|
+
blockSize?: number;
|
|
630
|
+
parallelization?: number;
|
|
631
|
+
N?: number;
|
|
632
|
+
r?: number;
|
|
633
|
+
p?: number;
|
|
634
|
+
maxmem?: number;
|
|
635
|
+
}
|
|
636
|
+
function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer;
|
|
637
|
+
function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void;
|
|
638
|
+
function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void;
|
|
639
|
+
function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void;
|
|
640
|
+
function hkdf(digest: string, ikm: BinaryLike, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void;
|
|
641
|
+
function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
|
642
|
+
function randomFillSync<T extends Uint8Array>(buffer: T, offset?: number, size?: number): T;
|
|
643
|
+
function randomFill<T extends Uint8Array>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
|
|
644
|
+
function randomFill<T extends Uint8Array>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
|
|
645
|
+
function randomFill<T extends Uint8Array>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
|
|
646
|
+
|
|
647
|
+
// Keys
|
|
648
|
+
type KeyObjectType = 'secret' | 'public' | 'private';
|
|
649
|
+
type KeyType = 'rsa' | 'ec' | 'ed25519' | 'x25519';
|
|
650
|
+
type KeyFormat = 'pem' | 'der' | 'jwk';
|
|
651
|
+
interface JsonWebKey {
|
|
652
|
+
kty?: string;
|
|
653
|
+
crv?: string;
|
|
654
|
+
x?: string;
|
|
655
|
+
y?: string;
|
|
656
|
+
d?: string;
|
|
657
|
+
n?: string;
|
|
658
|
+
e?: string;
|
|
659
|
+
k?: string;
|
|
660
|
+
[key: string]: unknown;
|
|
661
|
+
}
|
|
662
|
+
interface AsymmetricKeyDetails {
|
|
663
|
+
modulusLength?: number;
|
|
664
|
+
publicExponent?: bigint;
|
|
665
|
+
namedCurve?: string;
|
|
666
|
+
}
|
|
667
|
+
interface KeyExportOptions<T extends KeyFormat> {
|
|
668
|
+
type?: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
|
|
669
|
+
format: T;
|
|
670
|
+
}
|
|
671
|
+
interface JwkKeyExportOptions {
|
|
672
|
+
format: 'jwk';
|
|
673
|
+
}
|
|
674
|
+
class KeyObject {
|
|
675
|
+
private constructor();
|
|
676
|
+
static from(key: webcrypto.CryptoKey): KeyObject;
|
|
677
|
+
readonly type: KeyObjectType;
|
|
678
|
+
readonly asymmetricKeyType?: KeyType;
|
|
679
|
+
readonly asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
680
|
+
readonly symmetricKeySize?: number;
|
|
681
|
+
export(options: KeyExportOptions<'pem'>): string;
|
|
682
|
+
export(options: KeyExportOptions<'der'>): Buffer;
|
|
683
|
+
export(options: JwkKeyExportOptions): JsonWebKey;
|
|
684
|
+
export(options?: { format?: 'buffer' }): Buffer;
|
|
685
|
+
equals(otherKeyObject: KeyObject): boolean;
|
|
686
|
+
}
|
|
687
|
+
interface PrivateKeyInput {
|
|
688
|
+
key: string | Buffer;
|
|
689
|
+
format?: KeyFormat;
|
|
690
|
+
type?: 'pkcs1' | 'pkcs8' | 'sec1';
|
|
691
|
+
passphrase?: string | Buffer;
|
|
692
|
+
encoding?: string;
|
|
693
|
+
}
|
|
694
|
+
interface PublicKeyInput {
|
|
695
|
+
key: string | Buffer;
|
|
696
|
+
format?: KeyFormat;
|
|
697
|
+
type?: 'pkcs1' | 'spki';
|
|
698
|
+
encoding?: string;
|
|
699
|
+
}
|
|
700
|
+
interface JsonWebKeyInput {
|
|
701
|
+
key: JsonWebKey;
|
|
702
|
+
format: 'jwk';
|
|
703
|
+
}
|
|
704
|
+
type KeyLike = string | Buffer | KeyObject;
|
|
705
|
+
function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
|
|
706
|
+
function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject;
|
|
707
|
+
function createSecretKey(key: Uint8Array): KeyObject;
|
|
708
|
+
function createSecretKey(key: string, encoding: BufferEncoding): KeyObject;
|
|
709
|
+
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
710
|
+
format: T;
|
|
711
|
+
cipher?: string;
|
|
712
|
+
passphrase?: string;
|
|
713
|
+
}
|
|
714
|
+
interface KeyPairKeyObjectResult {
|
|
715
|
+
publicKey: KeyObject;
|
|
716
|
+
privateKey: KeyObject;
|
|
717
|
+
}
|
|
718
|
+
interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
|
|
719
|
+
publicKey: T1;
|
|
720
|
+
privateKey: T2;
|
|
721
|
+
}
|
|
722
|
+
interface KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
723
|
+
modulusLength?: number;
|
|
724
|
+
publicExponent?: number;
|
|
725
|
+
namedCurve?: string;
|
|
726
|
+
publicKeyEncoding: { type: 'pkcs1' | 'spki'; format: PubF };
|
|
727
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & { type: 'pkcs1' | 'pkcs8' | 'sec1' };
|
|
728
|
+
}
|
|
729
|
+
interface KeyPairKeyObjectOptions {
|
|
730
|
+
modulusLength?: number;
|
|
731
|
+
publicExponent?: number;
|
|
732
|
+
namedCurve?: string;
|
|
733
|
+
}
|
|
734
|
+
function generateKeyPairSync(type: KeyType, options: KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
|
735
|
+
function generateKeyPairSync(type: KeyType, options: KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
|
736
|
+
function generateKeyPairSync(type: KeyType, options?: KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
737
|
+
function generateKeyPair(type: KeyType, options: KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
|
738
|
+
function generateKeyPair(type: KeyType, options: KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
|
739
|
+
function generateKeyPair(type: KeyType, options: KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
|
|
740
|
+
function generateKeyPair(type: KeyType, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
|
|
741
|
+
function generateKeySync(type: 'hmac' | 'aes', options: { length: number }): KeyObject;
|
|
742
|
+
function generateKey(type: 'hmac' | 'aes', options: { length: number }, callback: (err: Error | null, key: KeyObject) => void): void;
|
|
743
|
+
|
|
744
|
+
// Signatures
|
|
745
|
+
interface SigningOptions {
|
|
746
|
+
padding?: number;
|
|
747
|
+
saltLength?: number;
|
|
748
|
+
dsaEncoding?: 'der' | 'ieee-p1363';
|
|
749
|
+
}
|
|
750
|
+
interface SignKeyObjectInput extends SigningOptions {
|
|
751
|
+
key: KeyLike;
|
|
752
|
+
}
|
|
753
|
+
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
|
754
|
+
interface VerifyKeyObjectInput extends SigningOptions {
|
|
755
|
+
key: KeyLike;
|
|
756
|
+
}
|
|
757
|
+
type SignKey = KeyLike | SignKeyObjectInput | SignPrivateKeyInput;
|
|
758
|
+
function sign(algorithm: string | null | undefined, data: Uint8Array, key: SignKey): Buffer;
|
|
759
|
+
function verify(algorithm: string | null | undefined, data: Uint8Array, key: SignKey | VerifyKeyObjectInput, signature: Uint8Array): boolean;
|
|
760
|
+
interface Sign {
|
|
761
|
+
update(data: BinaryLike, inputEncoding?: BufferEncoding): this;
|
|
762
|
+
sign(privateKey: SignKey): Buffer;
|
|
763
|
+
sign(privateKey: SignKey, outputFormat: BinaryToTextEncoding): string;
|
|
764
|
+
}
|
|
765
|
+
interface Verify {
|
|
766
|
+
update(data: BinaryLike, inputEncoding?: BufferEncoding): this;
|
|
767
|
+
verify(object: SignKey, signature: Uint8Array): boolean;
|
|
768
|
+
verify(object: SignKey, signature: string, signatureEncoding?: BinaryToTextEncoding): boolean;
|
|
769
|
+
}
|
|
770
|
+
function createSign(algorithm: string): Sign;
|
|
771
|
+
function createVerify(algorithm: string): Verify;
|
|
772
|
+
|
|
773
|
+
// RSA encryption
|
|
774
|
+
interface RsaKeyInput {
|
|
775
|
+
key: KeyLike;
|
|
776
|
+
padding?: number;
|
|
777
|
+
oaepHash?: string;
|
|
778
|
+
oaepLabel?: Uint8Array;
|
|
779
|
+
}
|
|
780
|
+
function publicEncrypt(key: RsaKeyInput | KeyLike, buffer: Uint8Array | string): Buffer;
|
|
781
|
+
function privateDecrypt(privateKey: RsaKeyInput | KeyLike, buffer: Uint8Array): Buffer;
|
|
782
|
+
function privateEncrypt(privateKey: RsaKeyInput | KeyLike, buffer: Uint8Array | string): Buffer;
|
|
783
|
+
function publicDecrypt(key: RsaKeyInput | KeyLike, buffer: Uint8Array): Buffer;
|
|
784
|
+
const constants: {
|
|
785
|
+
readonly RSA_PKCS1_PADDING: number;
|
|
786
|
+
readonly RSA_NO_PADDING: number;
|
|
787
|
+
readonly RSA_PKCS1_OAEP_PADDING: number;
|
|
788
|
+
readonly RSA_PKCS1_PSS_PADDING: number;
|
|
789
|
+
readonly RSA_PSS_SALTLEN_DIGEST: number;
|
|
790
|
+
readonly RSA_PSS_SALTLEN_MAX_SIGN: number;
|
|
791
|
+
readonly RSA_PSS_SALTLEN_AUTO: number;
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
// ECDH / Diffie-Hellman
|
|
795
|
+
type ECDHKeyFormat = 'compressed' | 'uncompressed';
|
|
796
|
+
interface ECDH {
|
|
797
|
+
generateKeys(): Buffer;
|
|
798
|
+
generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
799
|
+
computeSecret(otherPublicKey: Uint8Array): Buffer;
|
|
800
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
|
|
801
|
+
computeSecret(otherPublicKey: string | Uint8Array, inputEncoding: BinaryToTextEncoding | undefined, outputEncoding: BinaryToTextEncoding): string;
|
|
802
|
+
getPrivateKey(): Buffer;
|
|
803
|
+
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
804
|
+
getPublicKey(): Buffer;
|
|
805
|
+
getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
806
|
+
setPrivateKey(privateKey: Uint8Array): void;
|
|
807
|
+
setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void;
|
|
808
|
+
}
|
|
809
|
+
function createECDH(curveName: string): ECDH;
|
|
810
|
+
function getCurves(): string[];
|
|
811
|
+
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
|
|
812
|
+
interface DiffieHellman {
|
|
813
|
+
readonly verifyError: number;
|
|
814
|
+
generateKeys(): Buffer;
|
|
815
|
+
generateKeys(encoding: BinaryToTextEncoding): string;
|
|
816
|
+
computeSecret(otherPublicKey: Uint8Array): Buffer;
|
|
817
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
|
|
818
|
+
computeSecret(otherPublicKey: string | Uint8Array, inputEncoding: BinaryToTextEncoding | undefined, outputEncoding: BinaryToTextEncoding): string;
|
|
819
|
+
getPrime(): Buffer;
|
|
820
|
+
getPrime(encoding: BinaryToTextEncoding): string;
|
|
821
|
+
getGenerator(): Buffer;
|
|
822
|
+
getGenerator(encoding: BinaryToTextEncoding): string;
|
|
823
|
+
getPublicKey(): Buffer;
|
|
824
|
+
getPublicKey(encoding: BinaryToTextEncoding): string;
|
|
825
|
+
getPrivateKey(): Buffer;
|
|
826
|
+
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
827
|
+
setPublicKey(publicKey: Uint8Array): void;
|
|
828
|
+
setPublicKey(publicKey: string, encoding: BufferEncoding): void;
|
|
829
|
+
setPrivateKey(privateKey: Uint8Array): void;
|
|
830
|
+
setPrivateKey(privateKey: string, encoding: BufferEncoding): void;
|
|
831
|
+
}
|
|
832
|
+
type DiffieHellmanGroup = DiffieHellman;
|
|
833
|
+
function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
|
|
834
|
+
function createDiffieHellman(prime: Uint8Array, generator?: number | Uint8Array): DiffieHellman;
|
|
835
|
+
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | string, generatorEncoding?: BinaryToTextEncoding): DiffieHellman;
|
|
836
|
+
function getDiffieHellman(groupName: string): DiffieHellmanGroup;
|
|
837
|
+
function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
|
|
838
|
+
|
|
839
|
+
// Primes
|
|
840
|
+
function generatePrimeSync(size: number, options: { bigint: true; safe?: boolean; add?: bigint | Uint8Array; rem?: bigint | Uint8Array }): bigint;
|
|
841
|
+
function generatePrimeSync(size: number, options?: { bigint?: false; safe?: boolean; add?: bigint | Uint8Array; rem?: bigint | Uint8Array }): ArrayBuffer;
|
|
842
|
+
function generatePrime(size: number, options: { bigint: true; safe?: boolean }, callback: (err: Error | null, prime: bigint) => void): void;
|
|
843
|
+
function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
|
|
844
|
+
function generatePrime(size: number, options: { bigint?: false; safe?: boolean }, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
|
|
845
|
+
function checkPrimeSync(candidate: bigint | Uint8Array, options?: { checks?: number }): boolean;
|
|
846
|
+
function checkPrime(candidate: bigint | Uint8Array, callback: (err: Error | null, result: boolean) => void): void;
|
|
847
|
+
function checkPrime(candidate: bigint | Uint8Array, options: { checks?: number }, callback: (err: Error | null, result: boolean) => void): void;
|
|
848
|
+
|
|
849
|
+
// X509Certificate
|
|
850
|
+
class X509Certificate {
|
|
851
|
+
constructor(buffer: string | Uint8Array);
|
|
852
|
+
readonly subject: string;
|
|
853
|
+
readonly issuer: string;
|
|
854
|
+
readonly subjectAltName: string | undefined;
|
|
855
|
+
readonly validFrom: string;
|
|
856
|
+
readonly validTo: string;
|
|
857
|
+
readonly validFromDate: Date;
|
|
858
|
+
readonly validToDate: Date;
|
|
859
|
+
readonly fingerprint: string;
|
|
860
|
+
readonly fingerprint256: string;
|
|
861
|
+
readonly fingerprint512: string;
|
|
862
|
+
readonly serialNumber: string;
|
|
863
|
+
readonly ca: boolean;
|
|
864
|
+
readonly raw: Buffer;
|
|
865
|
+
readonly publicKey: KeyObject;
|
|
866
|
+
readonly keyUsage: string[] | undefined;
|
|
867
|
+
checkHost(name: string, options?: object): string | undefined;
|
|
868
|
+
checkIP(ip: string): string | undefined;
|
|
869
|
+
checkEmail(email: string, options?: object): string | undefined;
|
|
870
|
+
checkIssued(otherCert: X509Certificate): boolean;
|
|
871
|
+
verify(publicKey: KeyObject): boolean;
|
|
872
|
+
toString(): string;
|
|
873
|
+
toJSON(): string;
|
|
874
|
+
toLegacyObject(): Record<string, any>;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// webcrypto
|
|
878
|
+
const subtle: webcrypto.SubtleCrypto;
|
|
879
|
+
namespace webcrypto {
|
|
880
|
+
type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey';
|
|
881
|
+
type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki';
|
|
882
|
+
type AlgorithmIdentifier = string | { name: string; [key: string]: any };
|
|
883
|
+
type BufferSource = Uint8Array | ArrayBuffer;
|
|
884
|
+
interface CryptoKey {
|
|
885
|
+
readonly type: 'secret' | 'public' | 'private';
|
|
886
|
+
readonly extractable: boolean;
|
|
887
|
+
readonly algorithm: KeyAlgorithm;
|
|
888
|
+
readonly usages: KeyUsage[];
|
|
889
|
+
}
|
|
890
|
+
interface KeyAlgorithm {
|
|
891
|
+
name: string;
|
|
892
|
+
length?: number;
|
|
893
|
+
hash?: { name: string };
|
|
894
|
+
namedCurve?: string;
|
|
895
|
+
modulusLength?: number;
|
|
896
|
+
publicExponent?: Uint8Array;
|
|
897
|
+
}
|
|
898
|
+
interface CryptoKeyPair {
|
|
899
|
+
publicKey: CryptoKey;
|
|
900
|
+
privateKey: CryptoKey;
|
|
901
|
+
}
|
|
902
|
+
interface SubtleCrypto {
|
|
903
|
+
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
|
|
904
|
+
generateKey(algorithm: { name: 'HMAC' | 'AES-GCM' | 'AES-CBC' | 'AES-CTR'; [key: string]: any }, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
905
|
+
generateKey(algorithm: { name: 'RSASSA-PKCS1-v1_5' | 'RSA-PSS' | 'RSA-OAEP' | 'ECDSA' | 'ECDH'; [key: string]: any } | 'Ed25519' | 'X25519' | { name: 'Ed25519' | 'X25519' }, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
|
|
906
|
+
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
|
|
907
|
+
importKey(format: 'jwk', keyData: JsonWebKey, algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
908
|
+
importKey(format: 'pkcs8' | 'raw' | 'spki', keyData: BufferSource, algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
909
|
+
exportKey(format: 'jwk', key: CryptoKey): Promise<JsonWebKey>;
|
|
910
|
+
exportKey(format: 'pkcs8' | 'raw' | 'spki', key: CryptoKey): Promise<ArrayBuffer>;
|
|
911
|
+
sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
912
|
+
verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<boolean>;
|
|
913
|
+
encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
914
|
+
decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
915
|
+
deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
|
|
916
|
+
deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
917
|
+
wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): Promise<ArrayBuffer>;
|
|
918
|
+
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
export = crypto;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
declare module 'node:zlib' {
|
|
926
|
+
namespace zlib {
|
|
927
|
+
interface ZlibOptions {
|
|
928
|
+
level?: number;
|
|
929
|
+
}
|
|
930
|
+
type InputType = string | Uint8Array;
|
|
931
|
+
function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
|
932
|
+
function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
|
933
|
+
function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
|
934
|
+
function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
|
935
|
+
function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
|
936
|
+
function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
|
937
|
+
function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
|
938
|
+
function crc32(data: string | Uint8Array, value?: number): number;
|
|
939
|
+
type CompressCallback = (error: Error | null, result: Buffer) => void;
|
|
940
|
+
function gzip(buf: InputType, callback: CompressCallback): void;
|
|
941
|
+
function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
942
|
+
function gunzip(buf: InputType, callback: CompressCallback): void;
|
|
943
|
+
function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
944
|
+
function deflate(buf: InputType, callback: CompressCallback): void;
|
|
945
|
+
function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
946
|
+
function inflate(buf: InputType, callback: CompressCallback): void;
|
|
947
|
+
function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
948
|
+
function deflateRaw(buf: InputType, callback: CompressCallback): void;
|
|
949
|
+
function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
950
|
+
function inflateRaw(buf: InputType, callback: CompressCallback): void;
|
|
951
|
+
function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
952
|
+
function unzip(buf: InputType, callback: CompressCallback): void;
|
|
953
|
+
function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
954
|
+
namespace gzip { function __promisify__(buf: InputType, options?: ZlibOptions): Promise<Buffer>; }
|
|
955
|
+
namespace gunzip { function __promisify__(buf: InputType, options?: ZlibOptions): Promise<Buffer>; }
|
|
956
|
+
namespace deflate { function __promisify__(buf: InputType, options?: ZlibOptions): Promise<Buffer>; }
|
|
957
|
+
namespace inflate { function __promisify__(buf: InputType, options?: ZlibOptions): Promise<Buffer>; }
|
|
958
|
+
namespace deflateRaw { function __promisify__(buf: InputType, options?: ZlibOptions): Promise<Buffer>; }
|
|
959
|
+
namespace inflateRaw { function __promisify__(buf: InputType, options?: ZlibOptions): Promise<Buffer>; }
|
|
960
|
+
namespace unzip { function __promisify__(buf: InputType, options?: ZlibOptions): Promise<Buffer>; }
|
|
961
|
+
function createGzip(options?: ZlibOptions): import('node:stream').Transform;
|
|
962
|
+
function createGunzip(options?: ZlibOptions): import('node:stream').Transform;
|
|
963
|
+
function createDeflate(options?: ZlibOptions): import('node:stream').Transform;
|
|
964
|
+
function createInflate(options?: ZlibOptions): import('node:stream').Transform;
|
|
965
|
+
function createDeflateRaw(options?: ZlibOptions): import('node:stream').Transform;
|
|
966
|
+
function createInflateRaw(options?: ZlibOptions): import('node:stream').Transform;
|
|
967
|
+
function createUnzip(options?: ZlibOptions): import('node:stream').Transform;
|
|
968
|
+
const constants: {
|
|
969
|
+
readonly Z_NO_FLUSH: number;
|
|
970
|
+
readonly Z_SYNC_FLUSH: number;
|
|
971
|
+
readonly Z_FULL_FLUSH: number;
|
|
972
|
+
readonly Z_FINISH: number;
|
|
973
|
+
readonly Z_OK: number;
|
|
974
|
+
readonly Z_STREAM_END: number;
|
|
975
|
+
readonly Z_DATA_ERROR: number;
|
|
976
|
+
readonly Z_BUF_ERROR: number;
|
|
977
|
+
readonly Z_NO_COMPRESSION: number;
|
|
978
|
+
readonly Z_BEST_SPEED: number;
|
|
979
|
+
readonly Z_BEST_COMPRESSION: number;
|
|
980
|
+
readonly Z_DEFAULT_COMPRESSION: number;
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
export = zlib;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
declare module 'node:timers' {
|
|
987
|
+
namespace timers {
|
|
988
|
+
type Timeout = NodeJS.Timeout;
|
|
989
|
+
type Immediate = NodeJS.Immediate;
|
|
990
|
+
function setTimeout<A extends any[]>(callback: (...args: A) => void, ms?: number, ...args: A): NodeJS.Timeout;
|
|
991
|
+
function clearTimeout(timeout?: NodeJS.Timeout | number): void;
|
|
992
|
+
function setInterval<A extends any[]>(callback: (...args: A) => void, ms?: number, ...args: A): NodeJS.Timeout;
|
|
993
|
+
function clearInterval(interval?: NodeJS.Timeout | number): void;
|
|
994
|
+
function setImmediate<A extends any[]>(callback: (...args: A) => void, ...args: A): NodeJS.Immediate;
|
|
995
|
+
function clearImmediate(immediate?: NodeJS.Immediate | number): void;
|
|
996
|
+
function queueMicrotask(callback: () => void): void;
|
|
997
|
+
const promises: typeof import('node:timers/promises');
|
|
998
|
+
}
|
|
999
|
+
export = timers;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
declare module 'node:timers/promises' {
|
|
1003
|
+
namespace promises {
|
|
1004
|
+
interface TimerOptions {
|
|
1005
|
+
signal?: AbortSignal;
|
|
1006
|
+
}
|
|
1007
|
+
function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
|
|
1008
|
+
function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
|
|
1009
|
+
function setInterval<T = void>(delay?: number, value?: T): AsyncIterableIterator<T>;
|
|
1010
|
+
const scheduler: {
|
|
1011
|
+
wait(delay: number, options?: TimerOptions): Promise<void>;
|
|
1012
|
+
yield(): Promise<void>;
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
export = promises;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
declare module 'node:perf_hooks' {
|
|
1019
|
+
namespace perf_hooks {
|
|
1020
|
+
const performance: Performance;
|
|
1021
|
+
type PerformanceEntry = globalThis.PerformanceEntry;
|
|
1022
|
+
const PerformanceObserver: typeof globalThis.PerformanceObserver;
|
|
1023
|
+
type PerformanceObserver = globalThis.PerformanceObserver;
|
|
1024
|
+
type PerformanceObserverEntryList = globalThis.PerformanceObserverEntryList;
|
|
1025
|
+
interface Histogram {
|
|
1026
|
+
readonly count: number;
|
|
1027
|
+
readonly min: number;
|
|
1028
|
+
readonly max: number;
|
|
1029
|
+
readonly mean: number;
|
|
1030
|
+
readonly stddev: number;
|
|
1031
|
+
readonly exceeds: number;
|
|
1032
|
+
readonly percentiles: Map<number, number>;
|
|
1033
|
+
percentile(percentile: number): number;
|
|
1034
|
+
reset(): void;
|
|
1035
|
+
}
|
|
1036
|
+
interface RecordableHistogram extends Histogram {
|
|
1037
|
+
record(val: number | bigint): void;
|
|
1038
|
+
recordDelta(): void;
|
|
1039
|
+
}
|
|
1040
|
+
interface IntervalHistogram extends Histogram {
|
|
1041
|
+
enable(): boolean;
|
|
1042
|
+
disable(): boolean;
|
|
1043
|
+
}
|
|
1044
|
+
function createHistogram(options?: { lowest?: number | bigint; highest?: number | bigint; figures?: number }): RecordableHistogram;
|
|
1045
|
+
function monitorEventLoopDelay(options?: { resolution?: number }): IntervalHistogram;
|
|
1046
|
+
}
|
|
1047
|
+
export = perf_hooks;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
declare module 'node:tty' {
|
|
1051
|
+
namespace tty {
|
|
1052
|
+
function isatty(fd: number): boolean;
|
|
1053
|
+
}
|
|
1054
|
+
export = tty;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
declare module 'node:constants' {
|
|
1058
|
+
/** @deprecated fs.constants and os.constants.signals */
|
|
1059
|
+
namespace constants {
|
|
1060
|
+
const F_OK: number;
|
|
1061
|
+
const R_OK: number;
|
|
1062
|
+
const W_OK: number;
|
|
1063
|
+
const X_OK: number;
|
|
1064
|
+
const COPYFILE_EXCL: number;
|
|
1065
|
+
const O_RDONLY: number;
|
|
1066
|
+
const O_WRONLY: number;
|
|
1067
|
+
const O_RDWR: number;
|
|
1068
|
+
const S_IFMT: number;
|
|
1069
|
+
const S_IFREG: number;
|
|
1070
|
+
const S_IFDIR: number;
|
|
1071
|
+
const S_IFLNK: number;
|
|
1072
|
+
const SIGHUP: number;
|
|
1073
|
+
const SIGINT: number;
|
|
1074
|
+
const SIGQUIT: number;
|
|
1075
|
+
const SIGKILL: number;
|
|
1076
|
+
const SIGTERM: number;
|
|
1077
|
+
}
|
|
1078
|
+
export = constants;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
declare module 'node:events' {
|
|
1082
|
+
class EventEmitter {
|
|
1083
|
+
constructor(options?: { captureRejections?: boolean });
|
|
1084
|
+
static defaultMaxListeners: number;
|
|
1085
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
1086
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
1087
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
1088
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
1089
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
1090
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
1091
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
1092
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
1093
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
1094
|
+
listeners(eventName: string | symbol): Function[];
|
|
1095
|
+
rawListeners(eventName: string | symbol): Function[];
|
|
1096
|
+
listenerCount(eventName: string | symbol, listener?: Function): number;
|
|
1097
|
+
eventNames(): (string | symbol)[];
|
|
1098
|
+
setMaxListeners(n: number): this;
|
|
1099
|
+
getMaxListeners(): number;
|
|
1100
|
+
static once(emitter: EventEmitter, eventName: string | symbol, options?: { signal?: AbortSignal }): Promise<any[]>;
|
|
1101
|
+
static on(emitter: EventEmitter, eventName: string | symbol, options?: { signal?: AbortSignal }): AsyncIterableIterator<any[]>;
|
|
1102
|
+
static getEventListeners(emitter: EventEmitter, name: string | symbol): Function[];
|
|
1103
|
+
static listenerCount(emitter: EventEmitter, eventName: string | symbol): number;
|
|
1104
|
+
static readonly errorMonitor: unique symbol;
|
|
1105
|
+
static captureRejections: boolean;
|
|
1106
|
+
static getMaxListeners(emitter: EventEmitter | EventTarget): number;
|
|
1107
|
+
static setMaxListeners(n?: number, ...eventTargets: (EventEmitter | EventTarget)[]): void;
|
|
1108
|
+
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
|
1109
|
+
}
|
|
1110
|
+
namespace EventEmitter {
|
|
1111
|
+
export { EventEmitter };
|
|
1112
|
+
const defaultMaxListeners: number;
|
|
1113
|
+
function once(emitter: EventEmitter, eventName: string | symbol, options?: { signal?: AbortSignal }): Promise<any[]>;
|
|
1114
|
+
function on(emitter: EventEmitter, eventName: string | symbol, options?: { signal?: AbortSignal }): AsyncIterableIterator<any[]>;
|
|
1115
|
+
function getEventListeners(emitter: EventEmitter, name: string | symbol): Function[];
|
|
1116
|
+
function listenerCount(emitter: EventEmitter, eventName: string | symbol): number;
|
|
1117
|
+
const errorMonitor: typeof EventEmitter.errorMonitor;
|
|
1118
|
+
let captureRejections: boolean;
|
|
1119
|
+
function getMaxListeners(emitter: EventEmitter | EventTarget): number;
|
|
1120
|
+
function setMaxListeners(n?: number, ...eventTargets: (EventEmitter | EventTarget)[]): void;
|
|
1121
|
+
function addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
|
1122
|
+
const EventTarget: typeof globalThis.EventTarget;
|
|
1123
|
+
const Event: typeof globalThis.Event;
|
|
1124
|
+
const AbortController: typeof globalThis.AbortController;
|
|
1125
|
+
const AbortSignal: typeof globalThis.AbortSignal;
|
|
1126
|
+
}
|
|
1127
|
+
export = EventEmitter;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
declare module 'node:stream' {
|
|
1131
|
+
import { EventEmitter } from 'node:events';
|
|
1132
|
+
class Stream extends EventEmitter {}
|
|
1133
|
+
namespace Stream {
|
|
1134
|
+
type TransformCallback = (error?: Error | null, data?: any) => void;
|
|
1135
|
+
interface ReadableOptions {
|
|
1136
|
+
objectMode?: boolean;
|
|
1137
|
+
encoding?: BufferEncoding;
|
|
1138
|
+
highWaterMark?: number;
|
|
1139
|
+
read?(this: Readable, size: number): void;
|
|
1140
|
+
destroy?(error: Error | null, callback: (error?: Error | null) => void): void;
|
|
1141
|
+
}
|
|
1142
|
+
interface WritableOptions {
|
|
1143
|
+
objectMode?: boolean;
|
|
1144
|
+
decodeStrings?: boolean;
|
|
1145
|
+
highWaterMark?: number;
|
|
1146
|
+
write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
1147
|
+
final?(this: Writable, callback: (error?: Error | null) => void): void;
|
|
1148
|
+
destroy?(error: Error | null, callback: (error?: Error | null) => void): void;
|
|
1149
|
+
}
|
|
1150
|
+
interface DuplexOptions extends ReadableOptions, WritableOptions {}
|
|
1151
|
+
interface TransformOptions extends DuplexOptions {
|
|
1152
|
+
transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
|
|
1153
|
+
flush?(this: Transform, callback: TransformCallback): void;
|
|
1154
|
+
}
|
|
1155
|
+
class Readable extends Stream implements AsyncIterable<any> {
|
|
1156
|
+
constructor(options?: ReadableOptions);
|
|
1157
|
+
static from(iterable: Iterable<any> | AsyncIterable<any> | string | Uint8Array, options?: ReadableOptions): Readable;
|
|
1158
|
+
readonly readable: boolean;
|
|
1159
|
+
readonly readableEnded: boolean;
|
|
1160
|
+
readonly readableFlowing: boolean | null;
|
|
1161
|
+
readonly readableLength: number;
|
|
1162
|
+
readonly readableObjectMode: boolean;
|
|
1163
|
+
readonly destroyed: boolean;
|
|
1164
|
+
readonly closed: boolean;
|
|
1165
|
+
readonly errored: Error | null;
|
|
1166
|
+
_read(size: number): void;
|
|
1167
|
+
_destroy(error: Error | null, callback: (error?: Error | null) => void): void;
|
|
1168
|
+
push(chunk: any, encoding?: BufferEncoding): boolean;
|
|
1169
|
+
unshift(chunk: any, encoding?: BufferEncoding): void;
|
|
1170
|
+
read(size?: number): any;
|
|
1171
|
+
setEncoding(encoding: BufferEncoding): this;
|
|
1172
|
+
pause(): this;
|
|
1173
|
+
resume(): this;
|
|
1174
|
+
isPaused(): boolean;
|
|
1175
|
+
pipe<T extends Writable>(destination: T, options?: { end?: boolean }): T;
|
|
1176
|
+
destroy(error?: Error): this;
|
|
1177
|
+
[Symbol.asyncIterator](): AsyncIterator<any>;
|
|
1178
|
+
static toWeb(streamReadable: Readable, options?: { strategy?: QueuingStrategy }): ReadableStream;
|
|
1179
|
+
static fromWeb(readableStream: ReadableStream, options?: ReadableOptions): Readable;
|
|
1180
|
+
}
|
|
1181
|
+
class Writable extends Stream {
|
|
1182
|
+
static toWeb(streamWritable: Writable): WritableStream;
|
|
1183
|
+
static fromWeb(writableStream: WritableStream, options?: WritableOptions): Writable;
|
|
1184
|
+
constructor(options?: WritableOptions);
|
|
1185
|
+
readonly writable: boolean;
|
|
1186
|
+
readonly writableEnded: boolean;
|
|
1187
|
+
readonly writableFinished: boolean;
|
|
1188
|
+
readonly writableLength: number;
|
|
1189
|
+
readonly writableObjectMode: boolean;
|
|
1190
|
+
readonly destroyed: boolean;
|
|
1191
|
+
readonly closed: boolean;
|
|
1192
|
+
readonly errored: Error | null;
|
|
1193
|
+
_write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
1194
|
+
_final(callback: (error?: Error | null) => void): void;
|
|
1195
|
+
_destroy(error: Error | null, callback: (error?: Error | null) => void): void;
|
|
1196
|
+
write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
|
|
1197
|
+
write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
|
|
1198
|
+
end(cb?: () => void): this;
|
|
1199
|
+
end(chunk: any, cb?: () => void): this;
|
|
1200
|
+
end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
|
|
1201
|
+
cork(): void;
|
|
1202
|
+
uncork(): void;
|
|
1203
|
+
setDefaultEncoding(encoding: BufferEncoding): this;
|
|
1204
|
+
destroy(error?: Error): this;
|
|
1205
|
+
}
|
|
1206
|
+
class Duplex extends Readable implements Writable {
|
|
1207
|
+
static toWeb(streamDuplex: Duplex): { readable: ReadableStream; writable: WritableStream };
|
|
1208
|
+
static toWeb(streamReadable: Readable, options?: { strategy?: QueuingStrategy }): ReadableStream;
|
|
1209
|
+
static fromWeb(pair: { readable: ReadableStream; writable: WritableStream }, options?: DuplexOptions): Duplex;
|
|
1210
|
+
static fromWeb(readableStream: ReadableStream, options?: ReadableOptions): Readable;
|
|
1211
|
+
constructor(options?: DuplexOptions);
|
|
1212
|
+
readonly writable: boolean;
|
|
1213
|
+
readonly writableEnded: boolean;
|
|
1214
|
+
readonly writableFinished: boolean;
|
|
1215
|
+
readonly writableLength: number;
|
|
1216
|
+
readonly writableObjectMode: boolean;
|
|
1217
|
+
_write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
1218
|
+
_final(callback: (error?: Error | null) => void): void;
|
|
1219
|
+
write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
|
|
1220
|
+
write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
|
|
1221
|
+
end(cb?: () => void): this;
|
|
1222
|
+
end(chunk: any, cb?: () => void): this;
|
|
1223
|
+
end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
|
|
1224
|
+
cork(): void;
|
|
1225
|
+
uncork(): void;
|
|
1226
|
+
setDefaultEncoding(encoding: BufferEncoding): this;
|
|
1227
|
+
}
|
|
1228
|
+
class Transform extends Duplex {
|
|
1229
|
+
constructor(options?: TransformOptions);
|
|
1230
|
+
_transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
|
|
1231
|
+
_flush(callback: TransformCallback): void;
|
|
1232
|
+
}
|
|
1233
|
+
class PassThrough extends Transform {}
|
|
1234
|
+
function pipeline<T extends Writable | Duplex>(...args: [...streams: (Readable | Writable | Duplex)[], callback: (err: NodeJS.ErrnoException | null) => void]): T;
|
|
1235
|
+
function finished(stream: Readable | Writable, callback: (err?: NodeJS.ErrnoException | null) => void): void;
|
|
1236
|
+
function compose(...streams: (Readable | Writable | Duplex | ReadableStream | WritableStream | TransformStream)[]): Duplex;
|
|
1237
|
+
const promises: typeof import('node:stream/promises');
|
|
1238
|
+
const web: typeof import('node:stream/web');
|
|
1239
|
+
}
|
|
1240
|
+
export = Stream;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
declare module 'node:stream/promises' {
|
|
1244
|
+
import { Readable, Writable, Duplex } from 'node:stream';
|
|
1245
|
+
function pipeline(...streams: (Readable | Writable | Duplex)[]): Promise<void>;
|
|
1246
|
+
function finished(stream: Readable | Writable): Promise<void>;
|
|
1247
|
+
export { pipeline, finished };
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
declare module 'node:stream/consumers' {
|
|
1251
|
+
import { Readable } from 'node:stream';
|
|
1252
|
+
function text(stream: Readable | AsyncIterable<any>): Promise<string>;
|
|
1253
|
+
function json(stream: Readable | AsyncIterable<any>): Promise<unknown>;
|
|
1254
|
+
function buffer(stream: Readable | AsyncIterable<any>): Promise<Buffer>;
|
|
1255
|
+
export { text, json, buffer };
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
declare module 'node:http2' {
|
|
1259
|
+
import { EventEmitter } from 'node:events';
|
|
1260
|
+
import { Duplex } from 'node:stream';
|
|
1261
|
+
import * as http from 'node:http';
|
|
1262
|
+
import * as net from 'node:net';
|
|
1263
|
+
namespace http2 {
|
|
1264
|
+
interface IncomingHttpHeaders {
|
|
1265
|
+
':status'?: number;
|
|
1266
|
+
':method'?: string;
|
|
1267
|
+
':path'?: string;
|
|
1268
|
+
':authority'?: string;
|
|
1269
|
+
':scheme'?: string;
|
|
1270
|
+
[header: string]: string | string[] | number | undefined;
|
|
1271
|
+
}
|
|
1272
|
+
type OutgoingHttpHeaders = Record<string, string | number | string[] | undefined>;
|
|
1273
|
+
interface Http2Stream extends Duplex {
|
|
1274
|
+
readonly id: number | undefined;
|
|
1275
|
+
readonly rstCode: number;
|
|
1276
|
+
readonly aborted: boolean;
|
|
1277
|
+
readonly sentHeaders: OutgoingHttpHeaders;
|
|
1278
|
+
close(code?: number, callback?: () => void): void;
|
|
1279
|
+
}
|
|
1280
|
+
interface ServerHttp2Stream extends Http2Stream {
|
|
1281
|
+
readonly session: ServerHttp2Session;
|
|
1282
|
+
readonly headersSent: boolean;
|
|
1283
|
+
readonly pushAllowed: boolean;
|
|
1284
|
+
respond(headers?: OutgoingHttpHeaders, options?: { endStream?: boolean }): void;
|
|
1285
|
+
respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: object): void;
|
|
1286
|
+
pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream) => void): void;
|
|
1287
|
+
additionalHeaders(headers: OutgoingHttpHeaders): void;
|
|
1288
|
+
}
|
|
1289
|
+
interface ClientHttp2Stream extends Http2Stream {
|
|
1290
|
+
on(event: 'response', listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
|
1291
|
+
on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
|
1292
|
+
on(event: 'data', listener: (chunk: any) => void): this;
|
|
1293
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
1294
|
+
once(event: 'response', listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
|
1295
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
1296
|
+
}
|
|
1297
|
+
interface Http2Session extends EventEmitter {
|
|
1298
|
+
readonly closed: boolean;
|
|
1299
|
+
readonly destroyed: boolean;
|
|
1300
|
+
readonly encrypted: boolean | undefined;
|
|
1301
|
+
readonly alpnProtocol: string | undefined;
|
|
1302
|
+
readonly socket: net.Socket;
|
|
1303
|
+
close(callback?: () => void): void;
|
|
1304
|
+
destroy(error?: Error, code?: number): void;
|
|
1305
|
+
ref(): void;
|
|
1306
|
+
unref(): void;
|
|
1307
|
+
setTimeout(msecs: number, callback?: () => void): void;
|
|
1308
|
+
}
|
|
1309
|
+
interface ClientHttp2Session extends Http2Session {
|
|
1310
|
+
request(headers?: OutgoingHttpHeaders, options?: { endStream?: boolean }): ClientHttp2Stream;
|
|
1311
|
+
on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket) => void): this;
|
|
1312
|
+
on(event: 'error', listener: (err: Error) => void): this;
|
|
1313
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
1314
|
+
}
|
|
1315
|
+
interface ServerHttp2Session extends Http2Session {}
|
|
1316
|
+
type Http2ServerRequest = http.IncomingMessage;
|
|
1317
|
+
type Http2ServerResponse = http.ServerResponse;
|
|
1318
|
+
interface Http2Server extends http.Server {
|
|
1319
|
+
on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
|
1320
|
+
on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
1321
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
1322
|
+
}
|
|
1323
|
+
type Http2SecureServer = Http2Server;
|
|
1324
|
+
interface SecureServerOptions {
|
|
1325
|
+
key?: string | Buffer;
|
|
1326
|
+
cert?: string | Buffer;
|
|
1327
|
+
ca?: string | Buffer | (string | Buffer)[];
|
|
1328
|
+
allowHTTP1?: boolean;
|
|
1329
|
+
}
|
|
1330
|
+
interface Settings {
|
|
1331
|
+
headerTableSize?: number;
|
|
1332
|
+
enablePush?: boolean;
|
|
1333
|
+
initialWindowSize?: number;
|
|
1334
|
+
maxFrameSize?: number;
|
|
1335
|
+
maxConcurrentStreams?: number;
|
|
1336
|
+
maxHeaderListSize?: number;
|
|
1337
|
+
enableConnectProtocol?: boolean;
|
|
1338
|
+
}
|
|
1339
|
+
function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
|
|
1340
|
+
function createServer(options: object, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
|
|
1341
|
+
function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
|
|
1342
|
+
function connect(authority: string | URL, listener?: (session: ClientHttp2Session, socket: net.Socket) => void): ClientHttp2Session;
|
|
1343
|
+
function connect(authority: string | URL, options?: { ca?: string | Buffer | (string | Buffer)[]; rejectUnauthorized?: boolean; servername?: string }, listener?: (session: ClientHttp2Session, socket: net.Socket) => void): ClientHttp2Session;
|
|
1344
|
+
function getDefaultSettings(): Settings;
|
|
1345
|
+
const constants: {
|
|
1346
|
+
readonly HTTP2_HEADER_STATUS: ':status';
|
|
1347
|
+
readonly HTTP2_HEADER_METHOD: ':method';
|
|
1348
|
+
readonly HTTP2_HEADER_AUTHORITY: ':authority';
|
|
1349
|
+
readonly HTTP2_HEADER_SCHEME: ':scheme';
|
|
1350
|
+
readonly HTTP2_HEADER_PATH: ':path';
|
|
1351
|
+
readonly HTTP2_HEADER_CONTENT_TYPE: 'content-type';
|
|
1352
|
+
readonly HTTP2_HEADER_CONTENT_LENGTH: 'content-length';
|
|
1353
|
+
readonly HTTP2_HEADER_ACCEPT: 'accept';
|
|
1354
|
+
readonly HTTP2_HEADER_USER_AGENT: 'user-agent';
|
|
1355
|
+
readonly HTTP2_HEADER_COOKIE: 'cookie';
|
|
1356
|
+
readonly HTTP2_HEADER_SET_COOKIE: 'set-cookie';
|
|
1357
|
+
readonly HTTP2_HEADER_LOCATION: 'location';
|
|
1358
|
+
readonly HTTP2_METHOD_GET: 'GET';
|
|
1359
|
+
readonly HTTP2_METHOD_POST: 'POST';
|
|
1360
|
+
readonly HTTP2_METHOD_PUT: 'PUT';
|
|
1361
|
+
readonly HTTP2_METHOD_DELETE: 'DELETE';
|
|
1362
|
+
readonly HTTP2_METHOD_HEAD: 'HEAD';
|
|
1363
|
+
readonly HTTP2_METHOD_PATCH: 'PATCH';
|
|
1364
|
+
readonly HTTP2_METHOD_OPTIONS: 'OPTIONS';
|
|
1365
|
+
readonly NGHTTP2_NO_ERROR: number;
|
|
1366
|
+
readonly NGHTTP2_PROTOCOL_ERROR: number;
|
|
1367
|
+
readonly NGHTTP2_INTERNAL_ERROR: number;
|
|
1368
|
+
readonly NGHTTP2_CANCEL: number;
|
|
1369
|
+
readonly HTTP_STATUS_OK: number;
|
|
1370
|
+
readonly HTTP_STATUS_CREATED: number;
|
|
1371
|
+
readonly HTTP_STATUS_NO_CONTENT: number;
|
|
1372
|
+
readonly HTTP_STATUS_MOVED_PERMANENTLY: number;
|
|
1373
|
+
readonly HTTP_STATUS_FOUND: number;
|
|
1374
|
+
readonly HTTP_STATUS_NOT_MODIFIED: number;
|
|
1375
|
+
readonly HTTP_STATUS_BAD_REQUEST: number;
|
|
1376
|
+
readonly HTTP_STATUS_UNAUTHORIZED: number;
|
|
1377
|
+
readonly HTTP_STATUS_FORBIDDEN: number;
|
|
1378
|
+
readonly HTTP_STATUS_NOT_FOUND: number;
|
|
1379
|
+
readonly HTTP_STATUS_METHOD_NOT_ALLOWED: number;
|
|
1380
|
+
readonly HTTP_STATUS_INTERNAL_SERVER_ERROR: number;
|
|
1381
|
+
readonly HTTP_STATUS_SERVICE_UNAVAILABLE: number;
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
export = http2;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
declare module 'node:cluster' {
|
|
1388
|
+
import { EventEmitter } from 'node:events';
|
|
1389
|
+
import { ChildProcess } from 'node:child_process';
|
|
1390
|
+
namespace cluster {
|
|
1391
|
+
interface Address {
|
|
1392
|
+
address: string;
|
|
1393
|
+
port: number;
|
|
1394
|
+
addressType: number | 'udp4' | 'udp6';
|
|
1395
|
+
}
|
|
1396
|
+
interface ClusterSettings {
|
|
1397
|
+
args?: string[];
|
|
1398
|
+
silent?: boolean;
|
|
1399
|
+
exec?: string;
|
|
1400
|
+
execArgv?: string[];
|
|
1401
|
+
cwd?: string;
|
|
1402
|
+
}
|
|
1403
|
+
class Worker extends EventEmitter {
|
|
1404
|
+
readonly id: number;
|
|
1405
|
+
readonly process: ChildProcess;
|
|
1406
|
+
exitedAfterDisconnect: boolean;
|
|
1407
|
+
send(message: any, callback?: (error: Error | null) => void): boolean;
|
|
1408
|
+
kill(signal?: string): void;
|
|
1409
|
+
destroy(signal?: string): void;
|
|
1410
|
+
disconnect(): this;
|
|
1411
|
+
isConnected(): boolean;
|
|
1412
|
+
isDead(): boolean;
|
|
1413
|
+
on(event: 'message', listener: (message: any) => void): this;
|
|
1414
|
+
on(event: 'exit', listener: (code: number, signal: string) => void): this;
|
|
1415
|
+
on(event: 'listening', listener: (address: Address) => void): this;
|
|
1416
|
+
on(event: 'online' | 'disconnect', listener: () => void): this;
|
|
1417
|
+
on(event: 'error', listener: (error: Error) => void): this;
|
|
1418
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
1419
|
+
}
|
|
1420
|
+
const isPrimary: boolean;
|
|
1421
|
+
/** @deprecated */
|
|
1422
|
+
const isMaster: boolean;
|
|
1423
|
+
const isWorker: boolean;
|
|
1424
|
+
const workers: Record<string, Worker> | undefined;
|
|
1425
|
+
const worker: Worker | undefined;
|
|
1426
|
+
const settings: ClusterSettings;
|
|
1427
|
+
const schedulingPolicy: number;
|
|
1428
|
+
const SCHED_NONE: number;
|
|
1429
|
+
const SCHED_RR: number;
|
|
1430
|
+
function fork(env?: Record<string, string | undefined>): Worker;
|
|
1431
|
+
function setupPrimary(settings?: ClusterSettings): void;
|
|
1432
|
+
/** @deprecated */
|
|
1433
|
+
function setupMaster(settings?: ClusterSettings): void;
|
|
1434
|
+
function disconnect(callback?: () => void): void;
|
|
1435
|
+
function on(event: 'fork' | 'online' | 'disconnect', listener: (worker: Worker) => void): EventEmitter;
|
|
1436
|
+
function on(event: 'listening', listener: (worker: Worker, address: Address) => void): EventEmitter;
|
|
1437
|
+
function on(event: 'message', listener: (worker: Worker, message: any) => void): EventEmitter;
|
|
1438
|
+
function on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): EventEmitter;
|
|
1439
|
+
function once(event: 'fork' | 'online' | 'disconnect', listener: (worker: Worker) => void): EventEmitter;
|
|
1440
|
+
function once(event: 'listening', listener: (worker: Worker, address: Address) => void): EventEmitter;
|
|
1441
|
+
function once(event: 'message', listener: (worker: Worker, message: any) => void): EventEmitter;
|
|
1442
|
+
function once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): EventEmitter;
|
|
1443
|
+
function off(event: string, listener: (...args: any[]) => void): EventEmitter;
|
|
1444
|
+
function removeAllListeners(event?: string): EventEmitter;
|
|
1445
|
+
function emit(event: string, ...args: any[]): boolean;
|
|
1446
|
+
function listenerCount(event: string): number;
|
|
1447
|
+
}
|
|
1448
|
+
export = cluster;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
declare module 'node:stream/web' {
|
|
1452
|
+
const ReadableStream: typeof globalThis.ReadableStream;
|
|
1453
|
+
type ReadableStream<R = any> = globalThis.ReadableStream<R>;
|
|
1454
|
+
const ReadableStreamDefaultReader: typeof globalThis.ReadableStreamDefaultReader;
|
|
1455
|
+
type ReadableStreamDefaultReader<R = any> = globalThis.ReadableStreamDefaultReader<R>;
|
|
1456
|
+
type ReadableStreamDefaultController<R = any> = globalThis.ReadableStreamDefaultController<R>;
|
|
1457
|
+
type ReadableStreamReadResult<R> = globalThis.ReadableStreamReadResult<R>;
|
|
1458
|
+
const WritableStream: typeof globalThis.WritableStream;
|
|
1459
|
+
type WritableStream<W = any> = globalThis.WritableStream<W>;
|
|
1460
|
+
const WritableStreamDefaultWriter: typeof globalThis.WritableStreamDefaultWriter;
|
|
1461
|
+
type WritableStreamDefaultWriter<W = any> = globalThis.WritableStreamDefaultWriter<W>;
|
|
1462
|
+
type WritableStreamDefaultController = globalThis.WritableStreamDefaultController;
|
|
1463
|
+
const TransformStream: typeof globalThis.TransformStream;
|
|
1464
|
+
type TransformStream<I = any, O = any> = globalThis.TransformStream<I, O>;
|
|
1465
|
+
type TransformStreamDefaultController<O = any> = globalThis.TransformStreamDefaultController<O>;
|
|
1466
|
+
const TextEncoderStream: typeof globalThis.TextEncoderStream;
|
|
1467
|
+
type TextEncoderStream = globalThis.TextEncoderStream;
|
|
1468
|
+
const TextDecoderStream: typeof globalThis.TextDecoderStream;
|
|
1469
|
+
type TextDecoderStream = globalThis.TextDecoderStream;
|
|
1470
|
+
const CompressionStream: typeof globalThis.CompressionStream;
|
|
1471
|
+
type CompressionStream = globalThis.CompressionStream;
|
|
1472
|
+
const DecompressionStream: typeof globalThis.DecompressionStream;
|
|
1473
|
+
type DecompressionStream = globalThis.DecompressionStream;
|
|
1474
|
+
const CountQueuingStrategy: typeof globalThis.CountQueuingStrategy;
|
|
1475
|
+
type CountQueuingStrategy = globalThis.CountQueuingStrategy;
|
|
1476
|
+
const ByteLengthQueuingStrategy: typeof globalThis.ByteLengthQueuingStrategy;
|
|
1477
|
+
type ByteLengthQueuingStrategy = globalThis.ByteLengthQueuingStrategy;
|
|
1478
|
+
type QueuingStrategy<T = any> = globalThis.QueuingStrategy<T>;
|
|
1479
|
+
type UnderlyingSource<R = any> = globalThis.UnderlyingSource<R>;
|
|
1480
|
+
type UnderlyingSink<W = any> = globalThis.UnderlyingSink<W>;
|
|
1481
|
+
type Transformer<I = any, O = any> = globalThis.Transformer<I, O>;
|
|
32
1482
|
}
|
|
33
1483
|
|
|
34
1484
|
declare module 'node:child_process' {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1485
|
+
import { EventEmitter } from 'node:events';
|
|
1486
|
+
import { Readable, Writable } from 'node:stream';
|
|
1487
|
+
namespace child_process {
|
|
1488
|
+
type StdioOption = 'pipe' | 'inherit' | 'ignore';
|
|
1489
|
+
interface CommonOptions {
|
|
1490
|
+
cwd?: string;
|
|
1491
|
+
env?: Record<string, string | undefined>;
|
|
1492
|
+
shell?: boolean | string;
|
|
1493
|
+
stdio?: StdioOption | StdioOption[];
|
|
1494
|
+
input?: string | Uint8Array;
|
|
1495
|
+
}
|
|
1496
|
+
interface ExecException extends Error {
|
|
1497
|
+
code?: number;
|
|
1498
|
+
killed?: boolean;
|
|
1499
|
+
signal?: string;
|
|
1500
|
+
cmd?: string;
|
|
1501
|
+
stdout?: string;
|
|
1502
|
+
stderr?: string;
|
|
1503
|
+
}
|
|
1504
|
+
type ExecFileException = ExecException;
|
|
1505
|
+
interface SpawnSyncReturns<T> {
|
|
1506
|
+
pid: number;
|
|
1507
|
+
output: (T | null)[];
|
|
1508
|
+
stdout: T;
|
|
1509
|
+
stderr: T;
|
|
1510
|
+
status: number | null;
|
|
1511
|
+
signal: string | null;
|
|
1512
|
+
error?: Error;
|
|
1513
|
+
}
|
|
1514
|
+
class ChildProcess extends EventEmitter {
|
|
1515
|
+
readonly stdin: Writable;
|
|
1516
|
+
readonly stdout: Readable;
|
|
1517
|
+
readonly stderr: Readable;
|
|
1518
|
+
readonly pid: number | undefined;
|
|
1519
|
+
readonly exitCode: number | null;
|
|
1520
|
+
readonly signalCode: string | null;
|
|
1521
|
+
readonly killed: boolean;
|
|
1522
|
+
readonly spawnfile: string;
|
|
1523
|
+
readonly connected: boolean;
|
|
1524
|
+
kill(signal?: string | number): boolean;
|
|
1525
|
+
send(message: any, callback?: (error: Error | null) => void): boolean;
|
|
1526
|
+
disconnect(): void;
|
|
1527
|
+
}
|
|
1528
|
+
interface ForkOptions {
|
|
1529
|
+
cwd?: string;
|
|
1530
|
+
env?: Record<string, string | undefined>;
|
|
1531
|
+
execArgv?: string[];
|
|
1532
|
+
silent?: boolean;
|
|
1533
|
+
}
|
|
1534
|
+
// Runs this program again (a native binary holds one program) with an IPC channel
|
|
1535
|
+
function fork(modulePath: string | URL, options?: ForkOptions): ChildProcess;
|
|
1536
|
+
function fork(modulePath: string | URL, args?: readonly string[], options?: ForkOptions): ChildProcess;
|
|
1537
|
+
type ExecCallback = (error: ExecException | null, stdout: string, stderr: string) => void;
|
|
1538
|
+
function exec(command: string, callback?: ExecCallback): ChildProcess;
|
|
1539
|
+
function exec(command: string, options: CommonOptions & { encoding?: BufferEncoding | null }, callback?: ExecCallback): ChildProcess;
|
|
1540
|
+
function execFile(file: string, callback?: ExecCallback): ChildProcess;
|
|
1541
|
+
function execFile(file: string, args: readonly string[], callback?: ExecCallback): ChildProcess;
|
|
1542
|
+
function execFile(file: string, args: readonly string[], options: CommonOptions & { encoding?: BufferEncoding | null }, callback?: ExecCallback): ChildProcess;
|
|
1543
|
+
function spawn(command: string, options?: CommonOptions): ChildProcess;
|
|
1544
|
+
function spawn(command: string, args: readonly string[], options?: CommonOptions): ChildProcess;
|
|
1545
|
+
function execSync(command: string, options: CommonOptions & { encoding: BufferEncoding }): string;
|
|
1546
|
+
function execSync(command: string, options?: CommonOptions & { encoding?: 'buffer' | null }): Buffer;
|
|
1547
|
+
function execFileSync(file: string, args: readonly string[], options: CommonOptions & { encoding: BufferEncoding }): string;
|
|
1548
|
+
function execFileSync(file: string, args?: readonly string[], options?: CommonOptions & { encoding?: 'buffer' | null }): Buffer;
|
|
1549
|
+
function spawnSync(command: string, args: readonly string[], options: CommonOptions & { encoding: BufferEncoding }): SpawnSyncReturns<string>;
|
|
1550
|
+
function spawnSync(command: string, args?: readonly string[], options?: CommonOptions & { encoding?: 'buffer' | null }): SpawnSyncReturns<Buffer>;
|
|
39
1551
|
}
|
|
40
|
-
export
|
|
41
|
-
export function execSync(command: string): string;
|
|
42
|
-
export function spawnSync(
|
|
43
|
-
file: string,
|
|
44
|
-
args: string[],
|
|
45
|
-
options?: { stdio?: string; input?: string; encoding?: string }
|
|
46
|
-
): ExecResult;
|
|
1552
|
+
export = child_process;
|
|
47
1553
|
}
|
|
48
1554
|
|
|
49
1555
|
declare module 'node:readline' {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1556
|
+
import { EventEmitter } from 'node:events';
|
|
1557
|
+
import { Readable, Writable } from 'node:stream';
|
|
1558
|
+
namespace readline {
|
|
1559
|
+
interface ReadLineOptions {
|
|
1560
|
+
input: Readable;
|
|
1561
|
+
output?: Writable;
|
|
1562
|
+
prompt?: string;
|
|
1563
|
+
terminal?: boolean;
|
|
1564
|
+
}
|
|
1565
|
+
class Interface extends EventEmitter implements AsyncIterable<string> {
|
|
1566
|
+
readonly closed: boolean;
|
|
1567
|
+
question(query: string, callback: (answer: string) => void): void;
|
|
1568
|
+
prompt(preserveCursor?: boolean): void;
|
|
1569
|
+
setPrompt(prompt: string): void;
|
|
1570
|
+
getPrompt(): string;
|
|
1571
|
+
write(data: string): void;
|
|
1572
|
+
pause(): this;
|
|
1573
|
+
resume(): this;
|
|
1574
|
+
close(): void;
|
|
1575
|
+
[Symbol.asyncIterator](): AsyncIterator<string>;
|
|
1576
|
+
}
|
|
1577
|
+
function createInterface(options: ReadLineOptions): Interface;
|
|
1578
|
+
function createInterface(input: Readable, output?: Writable): Interface;
|
|
1579
|
+
/** TypeNative extension: prints the prompt and reads one line from stdin, synchronously */
|
|
1580
|
+
function question(prompt: string): string;
|
|
1581
|
+
type Direction = -1 | 0 | 1;
|
|
1582
|
+
function cursorTo(stream: Writable, x: number, callback?: () => void): boolean;
|
|
1583
|
+
function cursorTo(stream: Writable, x: number, y?: number, callback?: () => void): boolean;
|
|
1584
|
+
function moveCursor(stream: Writable, dx: number, dy: number, callback?: () => void): boolean;
|
|
1585
|
+
function clearLine(stream: Writable, dir: Direction, callback?: () => void): boolean;
|
|
1586
|
+
function clearScreenDown(stream: Writable, callback?: () => void): boolean;
|
|
1587
|
+
const promises: typeof import('node:readline/promises');
|
|
1588
|
+
}
|
|
1589
|
+
export = readline;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
declare module 'node:readline/promises' {
|
|
1593
|
+
import { EventEmitter } from 'node:events';
|
|
1594
|
+
import { Readable, Writable } from 'node:stream';
|
|
1595
|
+
namespace promises {
|
|
1596
|
+
class Interface extends EventEmitter implements AsyncIterable<string> {
|
|
1597
|
+
readonly closed: boolean;
|
|
1598
|
+
question(query: string, options?: { signal?: AbortSignal }): Promise<string>;
|
|
1599
|
+
prompt(preserveCursor?: boolean): void;
|
|
1600
|
+
setPrompt(prompt: string): void;
|
|
1601
|
+
getPrompt(): string;
|
|
1602
|
+
pause(): this;
|
|
1603
|
+
resume(): this;
|
|
1604
|
+
close(): void;
|
|
1605
|
+
[Symbol.asyncIterator](): AsyncIterator<string>;
|
|
1606
|
+
}
|
|
1607
|
+
function createInterface(options: { input: Readable; output?: Writable; prompt?: string; terminal?: boolean }): Interface;
|
|
1608
|
+
function createInterface(input: Readable, output?: Writable): Interface;
|
|
1609
|
+
}
|
|
1610
|
+
export = promises;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
declare module 'node:diagnostics_channel' {
|
|
1614
|
+
namespace diagnostics_channel {
|
|
1615
|
+
type ChannelListener = (message: unknown, name: string | symbol) => void;
|
|
1616
|
+
class Channel {
|
|
1617
|
+
readonly name: string | symbol;
|
|
1618
|
+
readonly hasSubscribers: boolean;
|
|
1619
|
+
publish(message: unknown): void;
|
|
1620
|
+
subscribe(onMessage: ChannelListener): void;
|
|
1621
|
+
unsubscribe(onMessage: ChannelListener): boolean;
|
|
1622
|
+
bindStore<T>(store: import('node:async_hooks').AsyncLocalStorage<T>, transform?: (message: any) => T): void;
|
|
1623
|
+
unbindStore(store: import('node:async_hooks').AsyncLocalStorage<any>): boolean;
|
|
1624
|
+
runStores<R, A extends any[]>(data: unknown, fn: (...args: A) => R, thisArg?: unknown, ...args: A): R;
|
|
1625
|
+
}
|
|
1626
|
+
interface TracingChannelSubscribers {
|
|
1627
|
+
start?: (message: any) => void;
|
|
1628
|
+
end?: (message: any) => void;
|
|
1629
|
+
asyncStart?: (message: any) => void;
|
|
1630
|
+
asyncEnd?: (message: any) => void;
|
|
1631
|
+
error?: (message: any) => void;
|
|
1632
|
+
}
|
|
1633
|
+
interface TracingChannelCollection {
|
|
1634
|
+
start: Channel;
|
|
1635
|
+
end: Channel;
|
|
1636
|
+
asyncStart: Channel;
|
|
1637
|
+
asyncEnd: Channel;
|
|
1638
|
+
error: Channel;
|
|
1639
|
+
}
|
|
1640
|
+
class TracingChannel implements TracingChannelCollection {
|
|
1641
|
+
readonly start: Channel;
|
|
1642
|
+
readonly end: Channel;
|
|
1643
|
+
readonly asyncStart: Channel;
|
|
1644
|
+
readonly asyncEnd: Channel;
|
|
1645
|
+
readonly error: Channel;
|
|
1646
|
+
readonly hasSubscribers: boolean;
|
|
1647
|
+
subscribe(subscribers: TracingChannelSubscribers): void;
|
|
1648
|
+
unsubscribe(subscribers: TracingChannelSubscribers): boolean;
|
|
1649
|
+
traceSync<R, A extends any[]>(fn: (...args: A) => R, context?: object, thisArg?: unknown, ...args: A): R;
|
|
1650
|
+
tracePromise<R, A extends any[]>(fn: (...args: A) => Promise<R>, context?: object, thisArg?: unknown, ...args: A): Promise<R>;
|
|
1651
|
+
traceCallback<R, A extends any[]>(fn: (...args: A) => R, position?: number, context?: object, thisArg?: unknown, ...args: A): R;
|
|
1652
|
+
}
|
|
1653
|
+
function tracingChannel(nameOrChannels: string | TracingChannelCollection): TracingChannel;
|
|
1654
|
+
function channel(name: string | symbol): Channel;
|
|
1655
|
+
function subscribe(name: string | symbol, onMessage: ChannelListener): void;
|
|
1656
|
+
function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean;
|
|
1657
|
+
function hasSubscribers(name: string | symbol): boolean;
|
|
1658
|
+
}
|
|
1659
|
+
export = diagnostics_channel;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
declare module 'node:sys' {
|
|
1663
|
+
import util = require('node:util');
|
|
1664
|
+
export = util;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
// Bare specifiers ('fs') are the same builtins as 'node:fs'
|
|
1668
|
+
declare module 'node:net' {
|
|
1669
|
+
import { EventEmitter } from 'node:events';
|
|
1670
|
+
import { Duplex } from 'node:stream';
|
|
1671
|
+
namespace net {
|
|
1672
|
+
interface AddressInfo {
|
|
1673
|
+
address: string;
|
|
1674
|
+
family: string;
|
|
1675
|
+
port: number;
|
|
1676
|
+
}
|
|
1677
|
+
interface SocketConstructorOpts {
|
|
1678
|
+
allowHalfOpen?: boolean;
|
|
1679
|
+
}
|
|
1680
|
+
interface TcpSocketConnectOpts {
|
|
1681
|
+
port: number;
|
|
1682
|
+
host?: string;
|
|
1683
|
+
family?: number;
|
|
1684
|
+
timeout?: number;
|
|
1685
|
+
allowHalfOpen?: boolean;
|
|
1686
|
+
}
|
|
1687
|
+
interface IpcSocketConnectOpts {
|
|
1688
|
+
path: string;
|
|
1689
|
+
timeout?: number;
|
|
1690
|
+
allowHalfOpen?: boolean;
|
|
1691
|
+
}
|
|
1692
|
+
type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
|
|
1693
|
+
class Socket extends Duplex {
|
|
1694
|
+
constructor(options?: SocketConstructorOpts);
|
|
1695
|
+
connect(port: number, host?: string, connectionListener?: () => void): this;
|
|
1696
|
+
connect(port: number, connectionListener?: () => void): this;
|
|
1697
|
+
connect(path: string, connectionListener?: () => void): this;
|
|
1698
|
+
connect(options: SocketConnectOpts, connectionListener?: () => void): this;
|
|
1699
|
+
setTimeout(timeout: number, callback?: () => void): this;
|
|
1700
|
+
setNoDelay(noDelay?: boolean): this;
|
|
1701
|
+
setKeepAlive(enable?: boolean, initialDelay?: number): this;
|
|
1702
|
+
address(): AddressInfo;
|
|
1703
|
+
ref(): this;
|
|
1704
|
+
unref(): this;
|
|
1705
|
+
resetAndDestroy(): this;
|
|
1706
|
+
destroySoon(): void;
|
|
1707
|
+
readonly bytesRead: number;
|
|
1708
|
+
readonly bytesWritten: number;
|
|
1709
|
+
readonly connecting: boolean;
|
|
1710
|
+
readonly pending: boolean;
|
|
1711
|
+
readonly readyState: 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed';
|
|
1712
|
+
readonly remoteAddress?: string | undefined;
|
|
1713
|
+
readonly remoteFamily?: string | undefined;
|
|
1714
|
+
readonly remotePort?: number | undefined;
|
|
1715
|
+
readonly localAddress?: string;
|
|
1716
|
+
readonly localPort?: number;
|
|
1717
|
+
readonly localFamily?: string;
|
|
1718
|
+
readonly timeout?: number | undefined;
|
|
1719
|
+
}
|
|
1720
|
+
interface ServerOpts {
|
|
1721
|
+
allowHalfOpen?: boolean;
|
|
1722
|
+
pauseOnConnect?: boolean;
|
|
1723
|
+
}
|
|
1724
|
+
interface ListenOptions {
|
|
1725
|
+
port?: number;
|
|
1726
|
+
host?: string;
|
|
1727
|
+
path?: string;
|
|
1728
|
+
backlog?: number;
|
|
1729
|
+
}
|
|
1730
|
+
class Server extends EventEmitter {
|
|
1731
|
+
constructor(connectionListener?: (socket: Socket) => void);
|
|
1732
|
+
constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void);
|
|
1733
|
+
listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
|
|
1734
|
+
listen(port?: number, hostname?: string, listeningListener?: () => void): this;
|
|
1735
|
+
listen(port?: number, listeningListener?: () => void): this;
|
|
1736
|
+
listen(path: string, listeningListener?: () => void): this;
|
|
1737
|
+
listen(options: ListenOptions, listeningListener?: () => void): this;
|
|
1738
|
+
close(callback?: (err?: Error) => void): this;
|
|
1739
|
+
address(): AddressInfo | string | null;
|
|
1740
|
+
getConnections(cb: (error: Error | null, count: number) => void): this;
|
|
1741
|
+
ref(): this;
|
|
1742
|
+
unref(): this;
|
|
1743
|
+
maxConnections: number;
|
|
1744
|
+
readonly listening: boolean;
|
|
1745
|
+
}
|
|
1746
|
+
function createServer(connectionListener?: (socket: Socket) => void): Server;
|
|
1747
|
+
function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server;
|
|
1748
|
+
function connect(options: SocketConnectOpts, connectionListener?: () => void): Socket;
|
|
1749
|
+
function connect(port: number, host?: string, connectionListener?: () => void): Socket;
|
|
1750
|
+
function connect(path: string, connectionListener?: () => void): Socket;
|
|
1751
|
+
function createConnection(options: SocketConnectOpts, connectionListener?: () => void): Socket;
|
|
1752
|
+
function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
|
|
1753
|
+
function createConnection(path: string, connectionListener?: () => void): Socket;
|
|
1754
|
+
function isIP(input: string): number;
|
|
1755
|
+
function isIPv4(input: string): boolean;
|
|
1756
|
+
function isIPv6(input: string): boolean;
|
|
1757
|
+
const Stream: typeof Socket;
|
|
1758
|
+
function getDefaultAutoSelectFamily(): boolean;
|
|
1759
|
+
function setDefaultAutoSelectFamily(value: boolean): void;
|
|
1760
|
+
function getDefaultAutoSelectFamilyAttemptTimeout(): number;
|
|
1761
|
+
function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void;
|
|
1762
|
+
type IPVersion = 'ipv4' | 'ipv6';
|
|
1763
|
+
interface SocketAddressInitOptions {
|
|
1764
|
+
address?: string;
|
|
1765
|
+
family?: IPVersion;
|
|
1766
|
+
flowlabel?: number;
|
|
1767
|
+
port?: number;
|
|
1768
|
+
}
|
|
1769
|
+
class SocketAddress {
|
|
1770
|
+
constructor(options?: SocketAddressInitOptions);
|
|
1771
|
+
readonly address: string;
|
|
1772
|
+
readonly family: IPVersion;
|
|
1773
|
+
readonly port: number;
|
|
1774
|
+
readonly flowlabel: number;
|
|
1775
|
+
toJSON(): { address: string; port: number; family: IPVersion; flowlabel: number };
|
|
1776
|
+
static parse(input: string): SocketAddress | undefined;
|
|
1777
|
+
}
|
|
1778
|
+
class BlockList {
|
|
1779
|
+
addAddress(address: string, type?: IPVersion): void;
|
|
1780
|
+
addAddress(address: SocketAddress): void;
|
|
1781
|
+
addRange(start: string, end: string, type?: IPVersion): void;
|
|
1782
|
+
addRange(start: SocketAddress, end: SocketAddress): void;
|
|
1783
|
+
addSubnet(net: string, prefix: number, type?: IPVersion): void;
|
|
1784
|
+
addSubnet(net: SocketAddress, prefix: number): void;
|
|
1785
|
+
check(address: string, type?: IPVersion): boolean;
|
|
1786
|
+
check(address: SocketAddress): boolean;
|
|
1787
|
+
readonly rules: readonly string[];
|
|
1788
|
+
static isBlockList(value: unknown): value is BlockList;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
export = net;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
declare module 'node:dns' {
|
|
1795
|
+
namespace dns {
|
|
1796
|
+
interface LookupOptions {
|
|
1797
|
+
family?: number | 'IPv4' | 'IPv6';
|
|
1798
|
+
all?: boolean;
|
|
1799
|
+
}
|
|
1800
|
+
interface LookupAddress {
|
|
1801
|
+
address: string;
|
|
1802
|
+
family: number;
|
|
1803
|
+
}
|
|
1804
|
+
interface MxRecord {
|
|
1805
|
+
exchange: string;
|
|
1806
|
+
priority: number;
|
|
1807
|
+
}
|
|
1808
|
+
interface SrvRecord {
|
|
1809
|
+
name: string;
|
|
1810
|
+
port: number;
|
|
1811
|
+
priority: number;
|
|
1812
|
+
weight: number;
|
|
1813
|
+
}
|
|
1814
|
+
function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
|
1815
|
+
function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
|
1816
|
+
function lookup(hostname: string, options: LookupOptions & { all: true }, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
|
|
1817
|
+
function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
|
1818
|
+
function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1819
|
+
function resolve(hostname: string, rrtype: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1820
|
+
function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
|
1821
|
+
function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
|
1822
|
+
function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
|
1823
|
+
function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1824
|
+
function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1825
|
+
function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1826
|
+
function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
|
1827
|
+
function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
|
1828
|
+
function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1829
|
+
function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
|
1830
|
+
function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
|
|
1831
|
+
function getServers(): string[];
|
|
1832
|
+
function setServers(servers: readonly string[]): void;
|
|
1833
|
+
function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
|
|
1834
|
+
interface ResolverOptions {
|
|
1835
|
+
timeout?: number;
|
|
1836
|
+
tries?: number;
|
|
1837
|
+
}
|
|
1838
|
+
class Resolver {
|
|
1839
|
+
constructor(options?: ResolverOptions);
|
|
1840
|
+
cancel(): void;
|
|
1841
|
+
getServers(): string[];
|
|
1842
|
+
setServers(servers: readonly string[]): void;
|
|
1843
|
+
setLocalAddress(ipv4?: string, ipv6?: string): void;
|
|
1844
|
+
resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1845
|
+
resolve(hostname: string, rrtype: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1846
|
+
resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
|
1847
|
+
resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
|
1848
|
+
resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
|
1849
|
+
resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1850
|
+
resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1851
|
+
resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1852
|
+
resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
|
1853
|
+
resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
|
1854
|
+
resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
|
1855
|
+
resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
|
1856
|
+
reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
|
|
1857
|
+
}
|
|
1858
|
+
function setDefaultResultOrder(order: 'ipv4first' | 'ipv6first' | 'verbatim'): void;
|
|
1859
|
+
function getDefaultResultOrder(): 'ipv4first' | 'ipv6first' | 'verbatim';
|
|
1860
|
+
const promises: typeof import('node:dns/promises');
|
|
1861
|
+
}
|
|
1862
|
+
export = dns;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
declare module 'node:dns/promises' {
|
|
1866
|
+
import { LookupOptions, LookupAddress, MxRecord, SrvRecord, ResolverOptions } from 'node:dns';
|
|
1867
|
+
namespace dnsPromises {
|
|
1868
|
+
function lookup(hostname: string, options: LookupOptions & { all: true }): Promise<LookupAddress[]>;
|
|
1869
|
+
function lookup(hostname: string, options?: number | LookupOptions): Promise<LookupAddress>;
|
|
1870
|
+
function resolve(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise<string[]>;
|
|
1871
|
+
function resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
|
|
1872
|
+
function resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
|
|
1873
|
+
function resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
|
|
1874
|
+
function resolve4(hostname: string): Promise<string[]>;
|
|
1875
|
+
function resolve6(hostname: string): Promise<string[]>;
|
|
1876
|
+
function resolveCname(hostname: string): Promise<string[]>;
|
|
1877
|
+
function resolveMx(hostname: string): Promise<MxRecord[]>;
|
|
1878
|
+
function resolveTxt(hostname: string): Promise<string[][]>;
|
|
1879
|
+
function resolveNs(hostname: string): Promise<string[]>;
|
|
1880
|
+
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
|
1881
|
+
function reverse(ip: string): Promise<string[]>;
|
|
1882
|
+
function getServers(): string[];
|
|
1883
|
+
function setServers(servers: readonly string[]): void;
|
|
1884
|
+
function lookupService(address: string, port: number): Promise<{ hostname: string; service: string }>;
|
|
1885
|
+
class Resolver {
|
|
1886
|
+
constructor(options?: ResolverOptions);
|
|
1887
|
+
cancel(): void;
|
|
1888
|
+
getServers(): string[];
|
|
1889
|
+
setServers(servers: readonly string[]): void;
|
|
1890
|
+
setLocalAddress(ipv4?: string, ipv6?: string): void;
|
|
1891
|
+
resolve(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise<string[]>;
|
|
1892
|
+
resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
|
|
1893
|
+
resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
|
|
1894
|
+
resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
|
|
1895
|
+
resolve4(hostname: string): Promise<string[]>;
|
|
1896
|
+
resolve6(hostname: string): Promise<string[]>;
|
|
1897
|
+
resolveCname(hostname: string): Promise<string[]>;
|
|
1898
|
+
resolveMx(hostname: string): Promise<MxRecord[]>;
|
|
1899
|
+
resolveTxt(hostname: string): Promise<string[][]>;
|
|
1900
|
+
resolveNs(hostname: string): Promise<string[]>;
|
|
1901
|
+
resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
|
1902
|
+
reverse(ip: string): Promise<string[]>;
|
|
1903
|
+
}
|
|
1904
|
+
function setDefaultResultOrder(order: 'ipv4first' | 'ipv6first' | 'verbatim'): void;
|
|
1905
|
+
function getDefaultResultOrder(): 'ipv4first' | 'ipv6first' | 'verbatim';
|
|
1906
|
+
}
|
|
1907
|
+
export = dnsPromises;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
declare module 'node:http' {
|
|
1911
|
+
import * as net from 'node:net';
|
|
1912
|
+
import { Readable, Writable } from 'node:stream';
|
|
1913
|
+
namespace http {
|
|
1914
|
+
// Repeated headers are joined with ', ' (see headersDistinct for every value)
|
|
1915
|
+
type IncomingHttpHeaders = Record<string, string>;
|
|
1916
|
+
type OutgoingHttpHeader = number | string | string[];
|
|
1917
|
+
type OutgoingHttpHeaders = Record<string, OutgoingHttpHeader>;
|
|
1918
|
+
class IncomingMessage extends Readable {
|
|
1919
|
+
readonly method?: string;
|
|
1920
|
+
readonly url?: string;
|
|
1921
|
+
readonly httpVersion: string;
|
|
1922
|
+
readonly httpVersionMajor: number;
|
|
1923
|
+
readonly httpVersionMinor: number;
|
|
1924
|
+
readonly headers: IncomingHttpHeaders;
|
|
1925
|
+
readonly headersDistinct: Record<string, string[]>;
|
|
1926
|
+
readonly rawHeaders: string[];
|
|
1927
|
+
readonly trailers: Record<string, string>;
|
|
1928
|
+
readonly statusCode?: number;
|
|
1929
|
+
readonly statusMessage?: string;
|
|
1930
|
+
readonly complete: boolean;
|
|
1931
|
+
readonly aborted: boolean;
|
|
1932
|
+
// A TLSSocket (encrypted: true) for https requests
|
|
1933
|
+
readonly socket: net.Socket & { readonly encrypted?: boolean };
|
|
1934
|
+
readonly connection: net.Socket;
|
|
1935
|
+
setTimeout(msecs: number, callback?: () => void): this;
|
|
1936
|
+
}
|
|
1937
|
+
class OutgoingMessage extends Writable {
|
|
1938
|
+
readonly headersSent: boolean;
|
|
1939
|
+
readonly socket: net.Socket | null;
|
|
1940
|
+
setHeader(name: string, value: OutgoingHttpHeader): this;
|
|
1941
|
+
getHeader(name: string): OutgoingHttpHeader | undefined;
|
|
1942
|
+
getHeaders(): OutgoingHttpHeaders;
|
|
1943
|
+
getHeaderNames(): string[];
|
|
1944
|
+
hasHeader(name: string): boolean;
|
|
1945
|
+
removeHeader(name: string): void;
|
|
1946
|
+
flushHeaders(): void;
|
|
1947
|
+
}
|
|
1948
|
+
class ServerResponse extends OutgoingMessage {
|
|
1949
|
+
statusCode: number;
|
|
1950
|
+
statusMessage: string;
|
|
1951
|
+
sendDate: boolean;
|
|
1952
|
+
readonly req: IncomingMessage;
|
|
1953
|
+
setHeaders(headers: Headers | Map<string, OutgoingHttpHeader> | OutgoingHttpHeaders): this;
|
|
1954
|
+
appendHeader(name: string, value: string | string[]): this;
|
|
1955
|
+
writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders | string[]): this;
|
|
1956
|
+
writeHead(statusCode: number, headers?: OutgoingHttpHeaders | string[]): this;
|
|
1957
|
+
writeContinue(): void;
|
|
1958
|
+
setTimeout(msecs: number, callback?: () => void): this;
|
|
1959
|
+
}
|
|
1960
|
+
class ClientRequest extends OutgoingMessage {
|
|
1961
|
+
readonly method: string;
|
|
1962
|
+
readonly path: string;
|
|
1963
|
+
readonly host: string;
|
|
1964
|
+
readonly protocol: string;
|
|
1965
|
+
readonly aborted: boolean;
|
|
1966
|
+
readonly reusedSocket: boolean;
|
|
1967
|
+
getRawHeaderNames(): string[];
|
|
1968
|
+
setTimeout(timeout: number, callback?: () => void): this;
|
|
1969
|
+
setNoDelay(noDelay?: boolean): void;
|
|
1970
|
+
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
|
|
1971
|
+
abort(): void;
|
|
1972
|
+
}
|
|
1973
|
+
interface ServerOptions {
|
|
1974
|
+
keepAlive?: boolean;
|
|
1975
|
+
keepAliveTimeout?: number;
|
|
1976
|
+
requestTimeout?: number;
|
|
1977
|
+
headersTimeout?: number;
|
|
1978
|
+
}
|
|
1979
|
+
type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
|
|
1980
|
+
class Server extends net.Server {
|
|
1981
|
+
constructor(requestListener?: RequestListener);
|
|
1982
|
+
constructor(options: ServerOptions, requestListener?: RequestListener);
|
|
1983
|
+
setTimeout(msecs?: number, callback?: () => void): this;
|
|
1984
|
+
closeAllConnections(): void;
|
|
1985
|
+
closeIdleConnections(): void;
|
|
1986
|
+
timeout: number;
|
|
1987
|
+
keepAliveTimeout: number;
|
|
1988
|
+
headersTimeout: number;
|
|
1989
|
+
requestTimeout: number;
|
|
1990
|
+
maxHeadersCount: number | null;
|
|
1991
|
+
}
|
|
1992
|
+
interface AgentOptions {
|
|
1993
|
+
keepAlive?: boolean;
|
|
1994
|
+
keepAliveMsecs?: number;
|
|
1995
|
+
maxSockets?: number;
|
|
1996
|
+
maxFreeSockets?: number;
|
|
1997
|
+
timeout?: number;
|
|
1998
|
+
}
|
|
1999
|
+
class Agent {
|
|
2000
|
+
constructor(options?: AgentOptions);
|
|
2001
|
+
readonly keepAlive: boolean;
|
|
2002
|
+
maxSockets: number;
|
|
2003
|
+
destroy(): void;
|
|
2004
|
+
}
|
|
2005
|
+
interface RequestOptions {
|
|
2006
|
+
protocol?: string | null;
|
|
2007
|
+
host?: string | null;
|
|
2008
|
+
hostname?: string | null;
|
|
2009
|
+
port?: number | string | null;
|
|
2010
|
+
path?: string | null;
|
|
2011
|
+
method?: string;
|
|
2012
|
+
headers?: OutgoingHttpHeaders;
|
|
2013
|
+
auth?: string | null;
|
|
2014
|
+
timeout?: number;
|
|
2015
|
+
socketPath?: string;
|
|
2016
|
+
signal?: AbortSignal;
|
|
2017
|
+
agent?: Agent | boolean;
|
|
2018
|
+
setHost?: boolean;
|
|
2019
|
+
family?: number;
|
|
2020
|
+
// https
|
|
2021
|
+
ca?: string | Buffer | Array<string | Buffer>;
|
|
2022
|
+
cert?: string | Buffer;
|
|
2023
|
+
key?: string | Buffer;
|
|
2024
|
+
rejectUnauthorized?: boolean;
|
|
2025
|
+
servername?: string;
|
|
2026
|
+
}
|
|
2027
|
+
const METHODS: string[];
|
|
2028
|
+
const STATUS_CODES: Record<number, string>;
|
|
2029
|
+
const maxHeaderSize: number;
|
|
2030
|
+
const globalAgent: Agent;
|
|
2031
|
+
function createServer(requestListener?: RequestListener): Server;
|
|
2032
|
+
function createServer(options: ServerOptions, requestListener?: RequestListener): Server;
|
|
2033
|
+
function request(url: string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
2034
|
+
function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
2035
|
+
function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
2036
|
+
function get(url: string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
2037
|
+
function get(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
2038
|
+
function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
2039
|
+
}
|
|
2040
|
+
export = http;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
declare module 'node:https' {
|
|
2044
|
+
import * as http from 'node:http';
|
|
2045
|
+
import * as tls from 'node:tls';
|
|
2046
|
+
namespace https {
|
|
2047
|
+
type ServerOptions = tls.TlsOptions & http.ServerOptions;
|
|
2048
|
+
type RequestOptions = http.RequestOptions;
|
|
2049
|
+
class Server extends http.Server {}
|
|
2050
|
+
class Agent extends http.Agent {}
|
|
2051
|
+
const globalAgent: Agent;
|
|
2052
|
+
function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
|
|
2053
|
+
function request(url: string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
2054
|
+
function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
2055
|
+
function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
2056
|
+
function get(url: string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
2057
|
+
function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
2058
|
+
function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
2059
|
+
}
|
|
2060
|
+
export = https;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
declare module 'node:tls' {
|
|
2064
|
+
import * as net from 'node:net';
|
|
2065
|
+
namespace tls {
|
|
2066
|
+
interface PeerCertificate {
|
|
2067
|
+
subject: Record<string, string>;
|
|
2068
|
+
issuer: Record<string, string>;
|
|
2069
|
+
subjectaltname: string;
|
|
2070
|
+
valid_from: string;
|
|
2071
|
+
valid_to: string;
|
|
2072
|
+
fingerprint: string;
|
|
2073
|
+
fingerprint256: string;
|
|
2074
|
+
fingerprint512: string;
|
|
2075
|
+
serialNumber: string;
|
|
2076
|
+
ca: boolean;
|
|
2077
|
+
raw: Buffer;
|
|
2078
|
+
}
|
|
2079
|
+
interface CipherNameAndProtocol {
|
|
2080
|
+
name: string;
|
|
2081
|
+
standardName: string;
|
|
2082
|
+
version: string;
|
|
2083
|
+
}
|
|
2084
|
+
interface SecureContextOptions {
|
|
2085
|
+
key?: string | Buffer;
|
|
2086
|
+
cert?: string | Buffer;
|
|
2087
|
+
ca?: string | Buffer | Array<string | Buffer>;
|
|
2088
|
+
minVersion?: 'TLSv1' | 'TLSv1.1' | 'TLSv1.2' | 'TLSv1.3';
|
|
2089
|
+
maxVersion?: 'TLSv1' | 'TLSv1.1' | 'TLSv1.2' | 'TLSv1.3';
|
|
2090
|
+
}
|
|
2091
|
+
interface TlsOptions extends SecureContextOptions {
|
|
2092
|
+
requestCert?: boolean;
|
|
2093
|
+
rejectUnauthorized?: boolean;
|
|
2094
|
+
ALPNProtocols?: string[];
|
|
2095
|
+
allowHalfOpen?: boolean;
|
|
2096
|
+
}
|
|
2097
|
+
interface ConnectionOptions extends SecureContextOptions {
|
|
2098
|
+
host?: string;
|
|
2099
|
+
port?: number;
|
|
2100
|
+
path?: string;
|
|
2101
|
+
servername?: string;
|
|
2102
|
+
rejectUnauthorized?: boolean;
|
|
2103
|
+
ALPNProtocols?: string[];
|
|
2104
|
+
timeout?: number;
|
|
2105
|
+
checkServerIdentity?: (hostname: string, cert: PeerCertificate) => Error | undefined;
|
|
2106
|
+
}
|
|
2107
|
+
function checkServerIdentity(hostname: string, cert: PeerCertificate | { subject?: Record<string, string>; subjectaltname?: string }): Error | undefined;
|
|
2108
|
+
interface SecureContext {
|
|
2109
|
+
options: SecureContextOptions;
|
|
2110
|
+
}
|
|
2111
|
+
class TLSSocket extends net.Socket {
|
|
2112
|
+
readonly authorized: boolean;
|
|
2113
|
+
readonly authorizationError: string | null;
|
|
2114
|
+
readonly encrypted: true;
|
|
2115
|
+
readonly alpnProtocol: string | false | null;
|
|
2116
|
+
readonly servername: string | false | null;
|
|
2117
|
+
getPeerCertificate(detailed?: boolean): PeerCertificate;
|
|
2118
|
+
getCertificate(): PeerCertificate | null;
|
|
2119
|
+
getProtocol(): string | null;
|
|
2120
|
+
getCipher(): CipherNameAndProtocol;
|
|
2121
|
+
}
|
|
2122
|
+
class Server extends net.Server {}
|
|
2123
|
+
const DEFAULT_MIN_VERSION: string;
|
|
2124
|
+
const DEFAULT_MAX_VERSION: string;
|
|
2125
|
+
const DEFAULT_ECDH_CURVE: string;
|
|
2126
|
+
function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
|
|
2127
|
+
function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
|
2128
|
+
function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
|
2129
|
+
function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
|
2130
|
+
function createSecureContext(options?: SecureContextOptions): SecureContext;
|
|
2131
|
+
function getCiphers(): string[];
|
|
2132
|
+
}
|
|
2133
|
+
export = tls;
|
|
53
2134
|
}
|
|
2135
|
+
|
|
2136
|
+
declare module 'node:dgram' {
|
|
2137
|
+
import { EventEmitter } from 'node:events';
|
|
2138
|
+
import { AddressInfo } from 'node:net';
|
|
2139
|
+
namespace dgram {
|
|
2140
|
+
type SocketType = 'udp4' | 'udp6';
|
|
2141
|
+
interface SocketOptions {
|
|
2142
|
+
type: SocketType;
|
|
2143
|
+
reuseAddr?: boolean;
|
|
2144
|
+
}
|
|
2145
|
+
interface RemoteInfo {
|
|
2146
|
+
address: string;
|
|
2147
|
+
family: 'IPv4' | 'IPv6';
|
|
2148
|
+
port: number;
|
|
2149
|
+
size: number;
|
|
2150
|
+
}
|
|
2151
|
+
interface BindOptions {
|
|
2152
|
+
port?: number;
|
|
2153
|
+
address?: string;
|
|
2154
|
+
}
|
|
2155
|
+
type SendCallback = (error: Error | null, bytes: number) => void;
|
|
2156
|
+
class Socket extends EventEmitter {
|
|
2157
|
+
bind(port?: number, address?: string, callback?: () => void): this;
|
|
2158
|
+
bind(port?: number, callback?: () => void): this;
|
|
2159
|
+
bind(callback?: () => void): this;
|
|
2160
|
+
bind(options: BindOptions, callback?: () => void): this;
|
|
2161
|
+
send(msg: string | Uint8Array | any[], port?: number, address?: string, callback?: SendCallback): void;
|
|
2162
|
+
send(msg: string | Uint8Array | any[], port?: number, callback?: SendCallback): void;
|
|
2163
|
+
send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: SendCallback): void;
|
|
2164
|
+
send(msg: string | Uint8Array | any[], callback?: SendCallback): void;
|
|
2165
|
+
connect(port: number, address?: string, callback?: () => void): void;
|
|
2166
|
+
connect(port: number, callback: () => void): void;
|
|
2167
|
+
disconnect(): void;
|
|
2168
|
+
remoteAddress(): AddressInfo;
|
|
2169
|
+
address(): AddressInfo;
|
|
2170
|
+
close(callback?: () => void): this;
|
|
2171
|
+
ref(): this;
|
|
2172
|
+
unref(): this;
|
|
2173
|
+
setBroadcast(flag: boolean): void;
|
|
2174
|
+
setTTL(ttl: number): number;
|
|
2175
|
+
setMulticastTTL(ttl: number): number;
|
|
2176
|
+
setMulticastLoopback(flag: boolean): boolean;
|
|
2177
|
+
setRecvBufferSize(size: number): void;
|
|
2178
|
+
setSendBufferSize(size: number): void;
|
|
2179
|
+
}
|
|
2180
|
+
function createSocket(type: SocketType | SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
|
2181
|
+
}
|
|
2182
|
+
export = dgram;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
declare module 'node:async_hooks' {
|
|
2186
|
+
namespace async_hooks {
|
|
2187
|
+
class AsyncLocalStorage<T> {
|
|
2188
|
+
constructor(options?: { name?: string });
|
|
2189
|
+
static bind<Func extends (...args: any[]) => any>(fn: Func): Func;
|
|
2190
|
+
static snapshot(): <R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R;
|
|
2191
|
+
readonly name: string;
|
|
2192
|
+
getStore(): T | undefined;
|
|
2193
|
+
run<R>(store: T, callback: () => R): R;
|
|
2194
|
+
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
|
|
2195
|
+
exit<R, TArgs extends any[]>(callback: (...args: TArgs) => R, ...args: TArgs): R;
|
|
2196
|
+
enterWith(store: T): void;
|
|
2197
|
+
disable(): void;
|
|
2198
|
+
}
|
|
2199
|
+
interface AsyncResourceOptions {
|
|
2200
|
+
triggerAsyncId?: number;
|
|
2201
|
+
requireManualDestroy?: boolean;
|
|
2202
|
+
}
|
|
2203
|
+
class AsyncResource {
|
|
2204
|
+
constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
|
|
2205
|
+
static bind<Func extends (...args: any[]) => any>(fn: Func, type?: string): Func;
|
|
2206
|
+
bind<Func extends (...args: any[]) => any>(fn: Func): Func;
|
|
2207
|
+
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
|
|
2208
|
+
emitDestroy(): this;
|
|
2209
|
+
asyncId(): number;
|
|
2210
|
+
triggerAsyncId(): number;
|
|
2211
|
+
}
|
|
2212
|
+
interface HookCallbacks {
|
|
2213
|
+
init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
|
|
2214
|
+
before?(asyncId: number): void;
|
|
2215
|
+
after?(asyncId: number): void;
|
|
2216
|
+
promiseResolve?(asyncId: number): void;
|
|
2217
|
+
destroy?(asyncId: number): void;
|
|
2218
|
+
}
|
|
2219
|
+
interface AsyncHook {
|
|
2220
|
+
enable(): this;
|
|
2221
|
+
disable(): this;
|
|
2222
|
+
}
|
|
2223
|
+
function createHook(callbacks: HookCallbacks): AsyncHook;
|
|
2224
|
+
function executionAsyncId(): number;
|
|
2225
|
+
function triggerAsyncId(): number;
|
|
2226
|
+
function executionAsyncResource(): object;
|
|
2227
|
+
}
|
|
2228
|
+
export = async_hooks;
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
declare module 'node:test' {
|
|
2232
|
+
function test(name?: string, fn?: test.TestFn): Promise<void>;
|
|
2233
|
+
function test(name?: string, options?: test.TestOptions, fn?: test.TestFn): Promise<void>;
|
|
2234
|
+
function test(fn?: test.TestFn): Promise<void>;
|
|
2235
|
+
namespace test {
|
|
2236
|
+
export { test };
|
|
2237
|
+
export function skip(name?: string, fn?: TestFn): Promise<void>;
|
|
2238
|
+
export function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
2239
|
+
export function todo(name?: string, fn?: TestFn): Promise<void>;
|
|
2240
|
+
export function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
2241
|
+
export function only(name?: string, fn?: TestFn): Promise<void>;
|
|
2242
|
+
export function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
2243
|
+
export interface TestOptions {
|
|
2244
|
+
skip?: boolean | string;
|
|
2245
|
+
todo?: boolean | string;
|
|
2246
|
+
only?: boolean;
|
|
2247
|
+
timeout?: number;
|
|
2248
|
+
concurrency?: number | boolean;
|
|
2249
|
+
}
|
|
2250
|
+
export type TestFn = (t: TestContext, done: (result?: any) => void) => any;
|
|
2251
|
+
export type SuiteFn = (s: SuiteContext) => any;
|
|
2252
|
+
export type HookFn = (c: TestContext, done: (result?: any) => void) => any;
|
|
2253
|
+
export interface MockFunctionCall<F extends (...args: any[]) => any> {
|
|
2254
|
+
arguments: Parameters<F>;
|
|
2255
|
+
result: ReturnType<F> | undefined;
|
|
2256
|
+
error: unknown;
|
|
2257
|
+
this: unknown;
|
|
2258
|
+
}
|
|
2259
|
+
export interface MockFunctionContext<F extends (...args: any[]) => any> {
|
|
2260
|
+
readonly calls: MockFunctionCall<F>[];
|
|
2261
|
+
callCount(): number;
|
|
2262
|
+
resetCalls(): void;
|
|
2263
|
+
mockImplementation(implementation: F): void;
|
|
2264
|
+
mockImplementationOnce(implementation: F, onCall?: number): void;
|
|
2265
|
+
restore(): void;
|
|
2266
|
+
}
|
|
2267
|
+
export type Mock<F extends (...args: any[]) => any> = F & { mock: MockFunctionContext<F> };
|
|
2268
|
+
export interface MockTracker {
|
|
2269
|
+
fn<F extends (...args: any[]) => any = (...args: any[]) => undefined>(original?: F): Mock<F>;
|
|
2270
|
+
fn<F extends (...args: any[]) => any, Implementation extends (...args: any[]) => any = F>(original: F, implementation: Implementation): Mock<F | Implementation>;
|
|
2271
|
+
reset(): void;
|
|
2272
|
+
restoreAll(): void;
|
|
2273
|
+
readonly timers: MockTimers;
|
|
2274
|
+
}
|
|
2275
|
+
export type Timer = 'setInterval' | 'setTimeout' | 'setImmediate' | 'Date';
|
|
2276
|
+
export interface MockTimersOptions {
|
|
2277
|
+
apis?: Timer[];
|
|
2278
|
+
now?: number | Date;
|
|
2279
|
+
}
|
|
2280
|
+
export interface MockTimers {
|
|
2281
|
+
enable(options?: MockTimersOptions): void;
|
|
2282
|
+
tick(milliseconds?: number): void;
|
|
2283
|
+
runAll(): void;
|
|
2284
|
+
setTime(milliseconds: number): void;
|
|
2285
|
+
reset(): void;
|
|
2286
|
+
}
|
|
2287
|
+
export interface TestContextAssert {
|
|
2288
|
+
ok(value: unknown, message?: string | Error): void;
|
|
2289
|
+
equal(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
2290
|
+
notEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
2291
|
+
strictEqual<T>(actual: unknown, expected: T, message?: string | Error): void;
|
|
2292
|
+
notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
2293
|
+
deepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
2294
|
+
notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
2295
|
+
deepStrictEqual<T>(actual: unknown, expected: T, message?: string | Error): void;
|
|
2296
|
+
notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
2297
|
+
throws(block: () => unknown, error?: unknown, message?: string | Error): void;
|
|
2298
|
+
doesNotThrow(block: () => unknown, message?: string | Error): void;
|
|
2299
|
+
rejects(block: (() => Promise<unknown>) | Promise<unknown>, error?: unknown, message?: string | Error): Promise<void>;
|
|
2300
|
+
doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
|
2301
|
+
match(value: string, regExp: RegExp, message?: string | Error): void;
|
|
2302
|
+
doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
|
2303
|
+
fail(message?: string | Error): never;
|
|
2304
|
+
ifError(value: unknown): void;
|
|
2305
|
+
}
|
|
2306
|
+
export interface TestContext {
|
|
2307
|
+
readonly name: string;
|
|
2308
|
+
readonly fullName: string;
|
|
2309
|
+
readonly filePath: string | undefined;
|
|
2310
|
+
readonly signal: AbortSignal;
|
|
2311
|
+
readonly mock: MockTracker;
|
|
2312
|
+
readonly assert: TestContextAssert;
|
|
2313
|
+
test(name?: string, fn?: TestFn): Promise<void>;
|
|
2314
|
+
test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
2315
|
+
test(fn?: TestFn): Promise<void>;
|
|
2316
|
+
skip(message?: string): void;
|
|
2317
|
+
todo(message?: string): void;
|
|
2318
|
+
diagnostic(message: string): void;
|
|
2319
|
+
plan(count: number): void;
|
|
2320
|
+
runOnly(shouldRunOnlyTests: boolean): void;
|
|
2321
|
+
before(fn?: HookFn): void;
|
|
2322
|
+
after(fn?: HookFn): void;
|
|
2323
|
+
beforeEach(fn?: HookFn): void;
|
|
2324
|
+
afterEach(fn?: HookFn): void;
|
|
2325
|
+
}
|
|
2326
|
+
export interface SuiteContext {
|
|
2327
|
+
readonly name: string;
|
|
2328
|
+
readonly fullName: string;
|
|
2329
|
+
readonly signal: AbortSignal;
|
|
2330
|
+
}
|
|
2331
|
+
export interface TestFunction {
|
|
2332
|
+
(name?: string, fn?: TestFn): Promise<void>;
|
|
2333
|
+
(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
2334
|
+
(fn?: TestFn): Promise<void>;
|
|
2335
|
+
skip(name?: string, fn?: TestFn): Promise<void>;
|
|
2336
|
+
skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
2337
|
+
todo(name?: string, fn?: TestFn): Promise<void>;
|
|
2338
|
+
todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
2339
|
+
only(name?: string, fn?: TestFn): Promise<void>;
|
|
2340
|
+
only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
2341
|
+
}
|
|
2342
|
+
export interface SuiteFunction {
|
|
2343
|
+
(name?: string, fn?: SuiteFn): Promise<void>;
|
|
2344
|
+
(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
|
2345
|
+
(fn?: SuiteFn): Promise<void>;
|
|
2346
|
+
skip(name?: string, fn?: SuiteFn): Promise<void>;
|
|
2347
|
+
skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
|
2348
|
+
todo(name?: string, fn?: SuiteFn): Promise<void>;
|
|
2349
|
+
todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
|
2350
|
+
only(name?: string, fn?: SuiteFn): Promise<void>;
|
|
2351
|
+
only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
|
2352
|
+
}
|
|
2353
|
+
export const it: TestFunction;
|
|
2354
|
+
export const describe: SuiteFunction;
|
|
2355
|
+
export const suite: SuiteFunction;
|
|
2356
|
+
export const mock: MockTracker;
|
|
2357
|
+
export function before(fn?: HookFn, options?: TestOptions): void;
|
|
2358
|
+
export function after(fn?: HookFn, options?: TestOptions): void;
|
|
2359
|
+
export function beforeEach(fn?: HookFn, options?: TestOptions): void;
|
|
2360
|
+
export function afterEach(fn?: HookFn, options?: TestOptions): void;
|
|
2361
|
+
}
|
|
2362
|
+
export = test;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
declare module 'node:worker_threads' {
|
|
2366
|
+
import { EventEmitter } from 'node:events';
|
|
2367
|
+
namespace worker_threads {
|
|
2368
|
+
interface WorkerOptions {
|
|
2369
|
+
workerData?: any;
|
|
2370
|
+
argv?: any[];
|
|
2371
|
+
env?: Record<string, string> | typeof SHARE_ENV;
|
|
2372
|
+
eval?: false;
|
|
2373
|
+
stdout?: boolean;
|
|
2374
|
+
stderr?: boolean;
|
|
2375
|
+
name?: string;
|
|
2376
|
+
}
|
|
2377
|
+
// Runs this program again (pass __filename or new URL(import.meta.url))
|
|
2378
|
+
class Worker extends EventEmitter {
|
|
2379
|
+
constructor(filename: string | URL, options?: WorkerOptions);
|
|
2380
|
+
readonly threadId: number;
|
|
2381
|
+
postMessage(value: any, transferList?: readonly any[]): void;
|
|
2382
|
+
terminate(): Promise<number>;
|
|
2383
|
+
ref(): this;
|
|
2384
|
+
unref(): this;
|
|
2385
|
+
}
|
|
2386
|
+
class MessagePort extends EventEmitter {
|
|
2387
|
+
onmessage: ((event: MessageEvent) => void) | null;
|
|
2388
|
+
postMessage(value: any, transferList?: readonly any[]): void;
|
|
2389
|
+
start(): void;
|
|
2390
|
+
close(): void;
|
|
2391
|
+
ref(): this;
|
|
2392
|
+
unref(): this;
|
|
2393
|
+
hasRef(): boolean;
|
|
2394
|
+
}
|
|
2395
|
+
class MessageChannel {
|
|
2396
|
+
readonly port1: MessagePort;
|
|
2397
|
+
readonly port2: MessagePort;
|
|
2398
|
+
}
|
|
2399
|
+
interface MessageEvent {
|
|
2400
|
+
readonly data: any;
|
|
2401
|
+
readonly type: string;
|
|
2402
|
+
}
|
|
2403
|
+
// Instances with the same name in this process
|
|
2404
|
+
class BroadcastChannel {
|
|
2405
|
+
constructor(name: string);
|
|
2406
|
+
readonly name: string;
|
|
2407
|
+
onmessage: ((event: MessageEvent) => void) | null;
|
|
2408
|
+
postMessage(message: unknown): void;
|
|
2409
|
+
addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
2410
|
+
close(): void;
|
|
2411
|
+
ref(): this;
|
|
2412
|
+
unref(): this;
|
|
2413
|
+
}
|
|
2414
|
+
const isMainThread: boolean;
|
|
2415
|
+
const parentPort: MessagePort | null;
|
|
2416
|
+
const workerData: any;
|
|
2417
|
+
const threadId: number;
|
|
2418
|
+
const resourceLimits: Record<string, number>;
|
|
2419
|
+
const SHARE_ENV: unique symbol;
|
|
2420
|
+
function receiveMessageOnPort(port: MessagePort): { message: any } | undefined;
|
|
2421
|
+
function getEnvironmentData(key: string): any;
|
|
2422
|
+
function setEnvironmentData(key: string, value: any): void;
|
|
2423
|
+
function markAsUntransferable(object: object): void;
|
|
2424
|
+
function isMarkedAsUntransferable(object: object): boolean;
|
|
2425
|
+
}
|
|
2426
|
+
export = worker_threads;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
declare module 'node:sqlite' {
|
|
2430
|
+
namespace sqlite {
|
|
2431
|
+
type SQLInputValue = null | number | bigint | string | Uint8Array;
|
|
2432
|
+
type SQLOutputValue = null | number | bigint | string | Uint8Array;
|
|
2433
|
+
interface DatabaseSyncOptions {
|
|
2434
|
+
open?: boolean;
|
|
2435
|
+
enableForeignKeyConstraints?: boolean;
|
|
2436
|
+
enableDoubleQuotedStringLiterals?: boolean;
|
|
2437
|
+
readOnly?: boolean;
|
|
2438
|
+
allowExtension?: boolean;
|
|
2439
|
+
timeout?: number;
|
|
2440
|
+
readBigInts?: boolean;
|
|
2441
|
+
returnArrays?: boolean;
|
|
2442
|
+
allowBareNamedParameters?: boolean;
|
|
2443
|
+
allowUnknownNamedParameters?: boolean;
|
|
2444
|
+
defensive?: boolean;
|
|
2445
|
+
limits?: Partial<DatabaseLimits>;
|
|
2446
|
+
}
|
|
2447
|
+
interface DatabaseLimits {
|
|
2448
|
+
length: number;
|
|
2449
|
+
sqlLength: number;
|
|
2450
|
+
column: number;
|
|
2451
|
+
exprDepth: number;
|
|
2452
|
+
compoundSelect: number;
|
|
2453
|
+
vdbeOp: number;
|
|
2454
|
+
functionArg: number;
|
|
2455
|
+
attach: number;
|
|
2456
|
+
likePatternLength: number;
|
|
2457
|
+
variableNumber: number;
|
|
2458
|
+
triggerDepth: number;
|
|
2459
|
+
}
|
|
2460
|
+
interface FunctionOptions {
|
|
2461
|
+
deterministic?: boolean;
|
|
2462
|
+
directOnly?: boolean;
|
|
2463
|
+
useBigIntArguments?: boolean;
|
|
2464
|
+
varargs?: boolean;
|
|
2465
|
+
}
|
|
2466
|
+
// Callbacks get each SQL argument converted to the type their parameter
|
|
2467
|
+
// declares ((x: number) => …), so their arguments are typed `any` here
|
|
2468
|
+
// rather than SQLOutputValue as in @types/node
|
|
2469
|
+
interface AggregateOptions<T extends SQLInputValue = SQLInputValue> extends FunctionOptions {
|
|
2470
|
+
start: T | (() => T);
|
|
2471
|
+
step: (accumulator: T, ...args: any[]) => T;
|
|
2472
|
+
result?: (accumulator: T) => SQLInputValue;
|
|
2473
|
+
inverse?: (accumulator: T, ...args: any[]) => T;
|
|
2474
|
+
}
|
|
2475
|
+
interface PrepareOptions {
|
|
2476
|
+
readBigInts?: boolean;
|
|
2477
|
+
returnArrays?: boolean;
|
|
2478
|
+
allowBareNamedParameters?: boolean;
|
|
2479
|
+
allowUnknownNamedParameters?: boolean;
|
|
2480
|
+
}
|
|
2481
|
+
// SQLite runs as Wasm inside the program (github.com/ncruces/go-sqlite3):
|
|
2482
|
+
// loadExtension, createSession / applyChangeset and serialize / deserialize
|
|
2483
|
+
// throw
|
|
2484
|
+
class DatabaseSync {
|
|
2485
|
+
constructor(path: string | Uint8Array | URL, options?: DatabaseSyncOptions);
|
|
2486
|
+
readonly isOpen: boolean;
|
|
2487
|
+
readonly isTransaction: boolean;
|
|
2488
|
+
readonly limits: DatabaseLimits;
|
|
2489
|
+
open(): void;
|
|
2490
|
+
close(): void;
|
|
2491
|
+
exec(sql: string): void;
|
|
2492
|
+
prepare(sql: string, options?: PrepareOptions): StatementSync;
|
|
2493
|
+
location(dbName?: string): string | null;
|
|
2494
|
+
function(name: string, options: FunctionOptions, fn: (...args: any[]) => SQLInputValue): void;
|
|
2495
|
+
function(name: string, fn: (...args: any[]) => SQLInputValue): void;
|
|
2496
|
+
aggregate(name: string, options: AggregateOptions): void;
|
|
2497
|
+
aggregate<T extends SQLInputValue>(name: string, options: AggregateOptions<T>): void;
|
|
2498
|
+
setAuthorizer(
|
|
2499
|
+
callback:
|
|
2500
|
+
| ((actionCode: number, arg1: string | null, arg2: string | null, dbName: string | null, triggerOrView: string | null) => number)
|
|
2501
|
+
| null
|
|
2502
|
+
): void;
|
|
2503
|
+
enableDefensive(active: boolean): void;
|
|
2504
|
+
createTagStore(maxSize?: number): SQLTagStore;
|
|
2505
|
+
enableLoadExtension(allow: boolean): void;
|
|
2506
|
+
loadExtension(path: string, entryPoint?: string): void;
|
|
2507
|
+
createSession(options?: { table?: string; db?: string }): never;
|
|
2508
|
+
applyChangeset(changeset: Uint8Array, options?: object): boolean;
|
|
2509
|
+
serialize(dbName?: string): Uint8Array;
|
|
2510
|
+
deserialize(buffer: Uint8Array, options?: { dbName?: string }): void;
|
|
2511
|
+
}
|
|
2512
|
+
interface StatementColumnMetadata {
|
|
2513
|
+
column: string | null;
|
|
2514
|
+
database: string | null;
|
|
2515
|
+
name: string;
|
|
2516
|
+
table: string | null;
|
|
2517
|
+
type: string | null;
|
|
2518
|
+
}
|
|
2519
|
+
interface StatementResultingChanges {
|
|
2520
|
+
changes: number | bigint;
|
|
2521
|
+
lastInsertRowid: number | bigint;
|
|
2522
|
+
}
|
|
2523
|
+
interface StatementIterator extends IterableIterator<Record<string, SQLOutputValue>> {}
|
|
2524
|
+
class StatementSync {
|
|
2525
|
+
private constructor();
|
|
2526
|
+
readonly sourceSQL: string;
|
|
2527
|
+
readonly expandedSQL: string;
|
|
2528
|
+
all(...anonymousParameters: SQLInputValue[]): Record<string, SQLOutputValue>[];
|
|
2529
|
+
all(namedParameters: Record<string, SQLInputValue>, ...anonymousParameters: SQLInputValue[]): Record<string, SQLOutputValue>[];
|
|
2530
|
+
get(...anonymousParameters: SQLInputValue[]): Record<string, SQLOutputValue> | undefined;
|
|
2531
|
+
get(namedParameters: Record<string, SQLInputValue>, ...anonymousParameters: SQLInputValue[]): Record<string, SQLOutputValue> | undefined;
|
|
2532
|
+
iterate(...anonymousParameters: SQLInputValue[]): StatementIterator;
|
|
2533
|
+
iterate(namedParameters: Record<string, SQLInputValue>, ...anonymousParameters: SQLInputValue[]): StatementIterator;
|
|
2534
|
+
run(...anonymousParameters: SQLInputValue[]): StatementResultingChanges;
|
|
2535
|
+
run(namedParameters: Record<string, SQLInputValue>, ...anonymousParameters: SQLInputValue[]): StatementResultingChanges;
|
|
2536
|
+
columns(): StatementColumnMetadata[];
|
|
2537
|
+
setAllowBareNamedParameters(enabled: boolean): void;
|
|
2538
|
+
setAllowUnknownNamedParameters(enabled: boolean): void;
|
|
2539
|
+
setReadBigInts(enabled: boolean): void;
|
|
2540
|
+
setReturnArrays(enabled: boolean): void;
|
|
2541
|
+
}
|
|
2542
|
+
interface SQLTagStore {
|
|
2543
|
+
readonly size: number;
|
|
2544
|
+
readonly capacity: number;
|
|
2545
|
+
readonly db: DatabaseSync;
|
|
2546
|
+
all(strings: TemplateStringsArray, ...params: SQLInputValue[]): Record<string, SQLOutputValue>[];
|
|
2547
|
+
get(strings: TemplateStringsArray, ...params: SQLInputValue[]): Record<string, SQLOutputValue> | undefined;
|
|
2548
|
+
iterate(strings: TemplateStringsArray, ...params: SQLInputValue[]): StatementIterator;
|
|
2549
|
+
run(strings: TemplateStringsArray, ...params: SQLInputValue[]): StatementResultingChanges;
|
|
2550
|
+
clear(): void;
|
|
2551
|
+
}
|
|
2552
|
+
interface BackupOptions {
|
|
2553
|
+
source?: string;
|
|
2554
|
+
target?: string;
|
|
2555
|
+
rate?: number;
|
|
2556
|
+
progress?: (progressInfo: BackupProgressInfo) => void;
|
|
2557
|
+
}
|
|
2558
|
+
interface BackupProgressInfo {
|
|
2559
|
+
totalPages: number;
|
|
2560
|
+
remainingPages: number;
|
|
2561
|
+
}
|
|
2562
|
+
function backup(sourceDb: DatabaseSync, path: string, options?: BackupOptions): Promise<number>;
|
|
2563
|
+
namespace constants {
|
|
2564
|
+
const SQLITE_CHANGESET_OMIT: number;
|
|
2565
|
+
const SQLITE_CHANGESET_REPLACE: number;
|
|
2566
|
+
const SQLITE_CHANGESET_ABORT: number;
|
|
2567
|
+
const SQLITE_CHANGESET_DATA: number;
|
|
2568
|
+
const SQLITE_CHANGESET_NOTFOUND: number;
|
|
2569
|
+
const SQLITE_CHANGESET_CONFLICT: number;
|
|
2570
|
+
const SQLITE_CHANGESET_CONSTRAINT: number;
|
|
2571
|
+
const SQLITE_CHANGESET_FOREIGN_KEY: number;
|
|
2572
|
+
const SQLITE_OK: number;
|
|
2573
|
+
const SQLITE_DENY: number;
|
|
2574
|
+
const SQLITE_IGNORE: number;
|
|
2575
|
+
const SQLITE_COPY: number;
|
|
2576
|
+
const SQLITE_CREATE_INDEX: number;
|
|
2577
|
+
const SQLITE_CREATE_TABLE: number;
|
|
2578
|
+
const SQLITE_CREATE_TEMP_INDEX: number;
|
|
2579
|
+
const SQLITE_CREATE_TEMP_TABLE: number;
|
|
2580
|
+
const SQLITE_CREATE_TEMP_TRIGGER: number;
|
|
2581
|
+
const SQLITE_CREATE_TEMP_VIEW: number;
|
|
2582
|
+
const SQLITE_CREATE_TRIGGER: number;
|
|
2583
|
+
const SQLITE_CREATE_VIEW: number;
|
|
2584
|
+
const SQLITE_DELETE: number;
|
|
2585
|
+
const SQLITE_DROP_INDEX: number;
|
|
2586
|
+
const SQLITE_DROP_TABLE: number;
|
|
2587
|
+
const SQLITE_DROP_TEMP_INDEX: number;
|
|
2588
|
+
const SQLITE_DROP_TEMP_TABLE: number;
|
|
2589
|
+
const SQLITE_DROP_TEMP_TRIGGER: number;
|
|
2590
|
+
const SQLITE_DROP_TEMP_VIEW: number;
|
|
2591
|
+
const SQLITE_DROP_TRIGGER: number;
|
|
2592
|
+
const SQLITE_DROP_VIEW: number;
|
|
2593
|
+
const SQLITE_INSERT: number;
|
|
2594
|
+
const SQLITE_PRAGMA: number;
|
|
2595
|
+
const SQLITE_READ: number;
|
|
2596
|
+
const SQLITE_SELECT: number;
|
|
2597
|
+
const SQLITE_TRANSACTION: number;
|
|
2598
|
+
const SQLITE_UPDATE: number;
|
|
2599
|
+
const SQLITE_ATTACH: number;
|
|
2600
|
+
const SQLITE_DETACH: number;
|
|
2601
|
+
const SQLITE_ALTER_TABLE: number;
|
|
2602
|
+
const SQLITE_REINDEX: number;
|
|
2603
|
+
const SQLITE_ANALYZE: number;
|
|
2604
|
+
const SQLITE_CREATE_VTABLE: number;
|
|
2605
|
+
const SQLITE_DROP_VTABLE: number;
|
|
2606
|
+
const SQLITE_FUNCTION: number;
|
|
2607
|
+
const SQLITE_SAVEPOINT: number;
|
|
2608
|
+
const SQLITE_RECURSIVE: number;
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
export = sqlite;
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
declare module 'path' { import m = require('node:path'); export = m; }
|
|
2615
|
+
declare module 'path/posix' { import m = require('node:path/posix'); export = m; }
|
|
2616
|
+
declare module 'path/win32' { import m = require('node:path/win32'); export = m; }
|
|
2617
|
+
declare module 'buffer' { import m = require('node:buffer'); export = m; }
|
|
2618
|
+
declare module 'fs' { import m = require('node:fs'); export = m; }
|
|
2619
|
+
declare module 'fs/promises' { import m = require('node:fs/promises'); export = m; }
|
|
2620
|
+
declare module 'url' { import m = require('node:url'); export = m; }
|
|
2621
|
+
declare module 'querystring' { import m = require('node:querystring'); export = m; }
|
|
2622
|
+
declare module 'punycode' { import m = require('node:punycode'); export = m; }
|
|
2623
|
+
declare module 'string_decoder' { import m = require('node:string_decoder'); export = m; }
|
|
2624
|
+
declare module 'os' { import m = require('node:os'); export = m; }
|
|
2625
|
+
declare module 'process' { import m = require('node:process'); export = m; }
|
|
2626
|
+
declare module 'console' { import m = require('node:console'); export = m; }
|
|
2627
|
+
declare module 'util' { import m = require('node:util'); export = m; }
|
|
2628
|
+
declare module 'util/types' { import m = require('node:util/types'); export = m; }
|
|
2629
|
+
declare module 'assert' { import m = require('node:assert'); export = m; }
|
|
2630
|
+
declare module 'assert/strict' { import m = require('node:assert/strict'); export = m; }
|
|
2631
|
+
declare module 'crypto' { import m = require('node:crypto'); export = m; }
|
|
2632
|
+
declare module 'zlib' { import m = require('node:zlib'); export = m; }
|
|
2633
|
+
declare module 'timers' { import m = require('node:timers'); export = m; }
|
|
2634
|
+
declare module 'timers/promises' { import m = require('node:timers/promises'); export = m; }
|
|
2635
|
+
declare module 'perf_hooks' { import m = require('node:perf_hooks'); export = m; }
|
|
2636
|
+
declare module 'tty' { import m = require('node:tty'); export = m; }
|
|
2637
|
+
declare module 'constants' { import m = require('node:constants'); export = m; }
|
|
2638
|
+
declare module 'events' { import m = require('node:events'); export = m; }
|
|
2639
|
+
declare module 'stream' { import m = require('node:stream'); export = m; }
|
|
2640
|
+
declare module 'stream/promises' { export * from 'node:stream/promises'; }
|
|
2641
|
+
declare module 'stream/consumers' { export * from 'node:stream/consumers'; }
|
|
2642
|
+
declare module 'stream/web' { export * from 'node:stream/web'; }
|
|
2643
|
+
declare module 'child_process' { import m = require('node:child_process'); export = m; }
|
|
2644
|
+
declare module 'readline' { import m = require('node:readline'); export = m; }
|
|
2645
|
+
declare module 'readline/promises' { import m = require('node:readline/promises'); export = m; }
|
|
2646
|
+
declare module 'diagnostics_channel' { import m = require('node:diagnostics_channel'); export = m; }
|
|
2647
|
+
declare module 'sys' { import m = require('node:sys'); export = m; }
|
|
2648
|
+
declare module 'net' { import m = require('node:net'); export = m; }
|
|
2649
|
+
declare module 'dns' { import m = require('node:dns'); export = m; }
|
|
2650
|
+
declare module 'dns/promises' { import m = require('node:dns/promises'); export = m; }
|
|
2651
|
+
declare module 'http' { import m = require('node:http'); export = m; }
|
|
2652
|
+
declare module 'https' { import m = require('node:https'); export = m; }
|
|
2653
|
+
declare module 'tls' { import m = require('node:tls'); export = m; }
|
|
2654
|
+
declare module 'dgram' { import m = require('node:dgram'); export = m; }
|
|
2655
|
+
declare module 'async_hooks' { import m = require('node:async_hooks'); export = m; }
|
|
2656
|
+
// node:test has no bare alias in Node ('test' is not a builtin)
|
|
2657
|
+
declare module 'worker_threads' { import m = require('node:worker_threads'); export = m; }
|
|
2658
|
+
declare module 'cluster' { import m = require('node:cluster'); export = m; }
|
|
2659
|
+
declare module 'http2' { import m = require('node:http2'); export = m; }
|