@psnext/slingcli 3.1.20260904-1 → 3.3.20260911-1
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/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-PBNSMEG7.js → chunk-VDBOM5UG.js} +9 -9
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +25 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +33 -43
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +9 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +221 -12
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +76 -30
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +37 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +106 -22
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +155 -32
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +65 -9
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-utils.js +217 -27
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +43 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +22 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/errors/index.js +20 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +11 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +11 -10
- package/node_modules/@smithy/core/dist-es/submodules/errors/errors.js +18 -0
- package/node_modules/@smithy/core/dist-es/submodules/errors/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js +11 -10
- package/node_modules/@smithy/core/dist-types/submodules/errors/errors.d.ts +44 -0
- package/node_modules/@smithy/core/dist-types/submodules/errors/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/errors.d.ts +44 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/node_modules/@smithy/core/errors.d.ts +5 -0
- package/node_modules/@smithy/core/errors.js +5 -0
- package/node_modules/@smithy/core/package.json +11 -2
- package/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/node/assert/strict.d.ts +56 -13
- package/node_modules/@types/node/assert.d.ts +190 -189
- package/node_modules/@types/node/async_hooks.d.ts +43 -151
- package/node_modules/@types/node/buffer.buffer.d.ts +13 -12
- package/node_modules/@types/node/buffer.d.ts +237 -102
- package/node_modules/@types/node/child_process.d.ts +154 -39
- package/node_modules/@types/node/cluster.d.ts +384 -238
- package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/node_modules/@types/node/console.d.ts +404 -45
- package/node_modules/@types/node/constants.d.ts +10 -3
- package/node_modules/@types/node/crypto.d.ts +1600 -1007
- package/node_modules/@types/node/dgram.d.ts +81 -133
- package/node_modules/@types/node/diagnostics_channel.d.ts +59 -277
- package/node_modules/@types/node/dns/promises.d.ts +15 -9
- package/node_modules/@types/node/dns.d.ts +183 -136
- package/node_modules/@types/node/domain.d.ts +32 -12
- package/node_modules/@types/node/events.d.ts +696 -728
- package/node_modules/@types/node/fs/promises.d.ts +85 -256
- package/node_modules/@types/node/fs.d.ts +525 -865
- package/node_modules/@types/node/globals.d.ts +34 -12
- package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
- package/node_modules/@types/node/http.d.ts +311 -432
- package/node_modules/@types/node/http2.d.ts +891 -545
- package/node_modules/@types/node/https.d.ts +243 -64
- package/node_modules/@types/node/index.d.ts +7 -25
- package/node_modules/@types/node/inspector.d.ts +58 -70
- package/node_modules/@types/node/inspector.generated.d.ts +411 -765
- package/node_modules/@types/node/module.d.ts +219 -54
- package/node_modules/@types/node/net.d.ts +222 -208
- package/node_modules/@types/node/os.d.ts +49 -41
- package/node_modules/@types/node/package.json +3 -13
- package/node_modules/@types/node/path.d.ts +141 -119
- package/node_modules/@types/node/perf_hooks.d.ts +673 -310
- package/node_modules/@types/node/process.d.ts +205 -389
- package/node_modules/@types/node/punycode.d.ts +31 -3
- package/node_modules/@types/node/querystring.d.ts +16 -3
- package/node_modules/@types/node/readline/promises.d.ts +6 -3
- package/node_modules/@types/node/readline.d.ts +152 -66
- package/node_modules/@types/node/repl.d.ts +109 -101
- package/node_modules/@types/node/sea.d.ts +116 -1
- package/node_modules/@types/node/sqlite.d.ts +68 -486
- package/node_modules/@types/node/stream/consumers.d.ts +15 -91
- package/node_modules/@types/node/stream/promises.d.ts +15 -136
- package/node_modules/@types/node/stream/web.d.ts +456 -179
- package/node_modules/@types/node/stream.d.ts +491 -603
- package/node_modules/@types/node/string_decoder.d.ts +43 -3
- package/node_modules/@types/node/test.d.ts +292 -513
- package/node_modules/@types/node/timers/promises.d.ts +18 -3
- package/node_modules/@types/node/timers.d.ts +141 -3
- package/node_modules/@types/node/tls.d.ts +242 -140
- package/node_modules/@types/node/trace_events.d.ts +97 -3
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +8 -7
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
- package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
- package/node_modules/@types/node/tty.d.ts +43 -61
- package/node_modules/@types/node/url.d.ts +584 -156
- package/node_modules/@types/node/util.d.ts +1110 -181
- package/node_modules/@types/node/v8.d.ts +36 -175
- package/node_modules/@types/node/vm.d.ts +209 -292
- package/node_modules/@types/node/wasi.d.ts +74 -24
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
- package/node_modules/@types/node/web-globals/domexception.d.ts +0 -15
- package/node_modules/@types/node/web-globals/events.d.ts +0 -9
- package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
- package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
- package/node_modules/@types/node/web-globals/streams.d.ts +0 -93
- package/node_modules/@types/node/worker_threads.d.ts +407 -257
- package/node_modules/@types/node/zlib.d.ts +165 -7
- package/node_modules/hono/dist/cjs/client/client.js +4 -4
- package/node_modules/hono/dist/cjs/hono-base.js +7 -6
- package/node_modules/hono/dist/cjs/jsx/base.js +18 -1
- package/node_modules/hono/dist/cjs/jsx/components.js +25 -26
- package/node_modules/hono/dist/cjs/jsx/context.js +5 -5
- package/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +2 -2
- package/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
- package/node_modules/hono/dist/client/client.js +4 -4
- package/node_modules/hono/dist/hono-base.js +7 -6
- package/node_modules/hono/dist/jsx/base.js +15 -1
- package/node_modules/hono/dist/jsx/components.js +26 -27
- package/node_modules/hono/dist/jsx/context.js +6 -6
- package/node_modules/hono/dist/jsx/dom/server.js +5 -1
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +3 -3
- package/node_modules/hono/dist/jsx/streaming.js +5 -6
- package/node_modules/hono/dist/types/context.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/base.d.ts +3 -0
- package/node_modules/hono/package.json +2 -2
- package/node_modules/jose/dist/types/index.d.ts +1 -2
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -11
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +13 -16
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -11
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -19
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +10 -16
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +18 -21
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -1
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +4 -6
- package/node_modules/jose/dist/types/jwks/local.d.ts +5 -4
- package/node_modules/jose/dist/types/jwks/remote.d.ts +20 -21
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +4 -4
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +8 -11
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +8 -11
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +10 -14
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +11 -17
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +14 -11
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +24 -22
- package/node_modules/jose/dist/types/jwt/sign.d.ts +3 -7
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -6
- package/node_modules/jose/dist/types/jwt/verify.d.ts +13 -6
- package/node_modules/jose/dist/types/key/export.d.ts +6 -6
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +9 -14
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +10 -10
- package/node_modules/jose/dist/types/key/import.d.ts +19 -18
- package/node_modules/jose/dist/types/types.d.ts +152 -247
- package/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +6 -1
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -3
- package/node_modules/jose/dist/types/util/errors.d.ts +29 -40
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +1 -2
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +9 -26
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +3 -3
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +11 -30
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +6 -6
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -57
- package/node_modules/jose/dist/webapi/jwk/embedded.js +3 -4
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +3 -6
- package/node_modules/jose/dist/webapi/jwks/local.js +16 -10
- package/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +2 -4
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +2 -2
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +8 -15
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +4 -14
- package/node_modules/jose/dist/webapi/jws/general/sign.js +4 -11
- package/node_modules/jose/dist/webapi/jws/general/verify.js +5 -7
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +2 -3
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +11 -25
- package/node_modules/jose/dist/webapi/jwt/sign.js +1 -1
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +1 -2
- package/node_modules/jose/dist/webapi/jwt/verify.js +4 -4
- package/node_modules/jose/dist/webapi/key/export.js +12 -16
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +4 -13
- package/node_modules/jose/dist/webapi/key/generate_secret.js +1 -1
- package/node_modules/jose/dist/webapi/key/import.js +5 -9
- package/node_modules/jose/dist/webapi/lib/asn1.js +2 -4
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +35 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +21 -29
- package/node_modules/jose/dist/webapi/lib/deflate.js +9 -19
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +0 -4
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +21 -54
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +26 -59
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +29 -43
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +37 -45
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
- package/node_modules/jose/dist/webapi/lib/key.js +119 -59
- package/node_modules/jose/dist/webapi/lib/key_management.js +45 -80
- package/node_modules/jose/dist/webapi/lib/{options.js → validate.js} +64 -3
- package/node_modules/jose/dist/webapi/util/base64url.js +5 -19
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
- package/node_modules/jose/package.json +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/retry-handler.js +42 -7
- package/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/undici/lib/interceptor/decompress.js +146 -14
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici-types/agent.d.ts +13 -12
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +12 -13
- package/node_modules/undici-types/client.d.ts +34 -55
- package/node_modules/undici-types/connector.d.ts +2 -4
- package/node_modules/undici-types/cookies.d.ts +0 -2
- package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
- package/node_modules/undici-types/dispatcher.d.ts +137 -134
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
- package/node_modules/undici-types/errors.d.ts +54 -82
- package/node_modules/undici-types/eventsource.d.ts +4 -9
- package/node_modules/undici-types/fetch.d.ts +24 -46
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +7 -7
- package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici-types/global-origin.d.ts +5 -5
- package/node_modules/undici-types/handlers.d.ts +9 -8
- package/node_modules/undici-types/header.d.ts +1 -162
- package/node_modules/undici-types/index.d.ts +47 -69
- package/node_modules/undici-types/interceptors.d.ts +9 -72
- package/node_modules/undici-types/mock-agent.d.ts +18 -36
- package/node_modules/undici-types/mock-client.d.ts +4 -6
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
- package/node_modules/undici-types/mock-pool.d.ts +4 -6
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +4 -0
- package/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/node_modules/undici-types/pool.d.ts +14 -14
- package/node_modules/undici-types/proxy-agent.d.ts +6 -7
- package/node_modules/undici-types/readable.d.ts +16 -19
- package/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/node_modules/undici-types/retry-handler.d.ts +10 -19
- package/node_modules/undici-types/util.d.ts +3 -3
- package/node_modules/undici-types/webidl.d.ts +30 -148
- package/node_modules/undici-types/websocket.d.ts +10 -48
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/checks.ts +0 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +255 -164
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +59 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +274 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +18 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +225 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +25 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +147 -3
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +30 -6
- package/node_modules/zod/src/v4/core/checks.ts +1 -101
- package/node_modules/zod/src/v4/core/compile.ts +202 -88
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +226 -68
- package/node_modules/zod/src/v4/core/memoizer.ts +78 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +10 -4
- package/node_modules/zod/src/v4/core/schemas.ts +359 -122
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +222 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +10 -8
- package/node_modules/zod/src/v4/core/util.ts +222 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +11 -0
- package/node_modules/zod/src/v4/locales/ar.ts +1 -0
- package/node_modules/zod/src/v4/locales/az.ts +1 -0
- package/node_modules/zod/src/v4/locales/be.ts +1 -0
- package/node_modules/zod/src/v4/locales/bg.ts +1 -0
- package/node_modules/zod/src/v4/locales/bn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ca.ts +1 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +1 -0
- package/node_modules/zod/src/v4/locales/cs.ts +1 -0
- package/node_modules/zod/src/v4/locales/da.ts +1 -0
- package/node_modules/zod/src/v4/locales/de.ts +1 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +1 -0
- package/node_modules/zod/src/v4/locales/eo.ts +1 -0
- package/node_modules/zod/src/v4/locales/es.ts +1 -0
- package/node_modules/zod/src/v4/locales/fa.ts +1 -0
- package/node_modules/zod/src/v4/locales/fi.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr.ts +1 -0
- package/node_modules/zod/src/v4/locales/gu.ts +1 -0
- package/node_modules/zod/src/v4/locales/he.ts +1 -0
- package/node_modules/zod/src/v4/locales/hi.ts +1 -0
- package/node_modules/zod/src/v4/locales/hr.ts +1 -0
- package/node_modules/zod/src/v4/locales/hu.ts +1 -0
- package/node_modules/zod/src/v4/locales/hy.ts +1 -0
- package/node_modules/zod/src/v4/locales/id.ts +1 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +1 -0
- package/node_modules/zod/src/v4/locales/it.ts +1 -0
- package/node_modules/zod/src/v4/locales/ja.ts +1 -0
- package/node_modules/zod/src/v4/locales/ka.ts +1 -0
- package/node_modules/zod/src/v4/locales/km.ts +1 -0
- package/node_modules/zod/src/v4/locales/kn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ko.ts +1 -0
- package/node_modules/zod/src/v4/locales/lt.ts +1 -0
- package/node_modules/zod/src/v4/locales/mk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ms.ts +1 -0
- package/node_modules/zod/src/v4/locales/ne.ts +1 -0
- package/node_modules/zod/src/v4/locales/nl.ts +1 -0
- package/node_modules/zod/src/v4/locales/nn.ts +1 -0
- package/node_modules/zod/src/v4/locales/no.ts +1 -0
- package/node_modules/zod/src/v4/locales/ota.ts +1 -0
- package/node_modules/zod/src/v4/locales/pl.ts +1 -0
- package/node_modules/zod/src/v4/locales/ps.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt.ts +1 -0
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +1 -0
- package/node_modules/zod/src/v4/locales/sk.ts +1 -0
- package/node_modules/zod/src/v4/locales/sl.ts +1 -0
- package/node_modules/zod/src/v4/locales/sv.ts +1 -0
- package/node_modules/zod/src/v4/locales/ta.ts +1 -0
- package/node_modules/zod/src/v4/locales/tg.ts +134 -0
- package/node_modules/zod/src/v4/locales/th.ts +1 -0
- package/node_modules/zod/src/v4/locales/tk.ts +1 -0
- package/node_modules/zod/src/v4/locales/tr.ts +1 -0
- package/node_modules/zod/src/v4/locales/uk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ur.ts +1 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +1 -0
- package/node_modules/zod/src/v4/locales/yo.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +1 -0
- package/node_modules/zod/src/v4/mini/checks.ts +0 -1
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +39 -3
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +30 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +16 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +20 -2
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -31
- package/node_modules/zod/v4/classic/schemas.d.cts +17 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +17 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -29
- package/node_modules/zod/v4/core/api.cjs +37 -2
- package/node_modules/zod/v4/core/api.d.cts +6 -4
- package/node_modules/zod/v4/core/api.d.ts +6 -4
- package/node_modules/zod/v4/core/api.js +17 -2
- package/node_modules/zod/v4/core/checks.cjs +19 -96
- package/node_modules/zod/v4/core/checks.d.cts +1 -1
- package/node_modules/zod/v4/core/checks.d.ts +1 -1
- package/node_modules/zod/v4/core/checks.js +0 -96
- package/node_modules/zod/v4/core/compile.cjs +172 -72
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +153 -73
- package/node_modules/zod/v4/core/core.cjs +19 -0
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +215 -63
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +17 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +17 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +195 -64
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +114 -23
- package/node_modules/zod/v4/core/memoizer.js +72 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +29 -6
- package/node_modules/zod/v4/core/regexes.d.cts +2 -0
- package/node_modules/zod/v4/core/regexes.d.ts +2 -0
- package/node_modules/zod/v4/core/regexes.js +8 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +331 -103
- package/node_modules/zod/v4/core/schemas.d.cts +43 -8
- package/node_modules/zod/v4/core/schemas.d.ts +43 -8
- package/node_modules/zod/v4/core/schemas.js +310 -102
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +29 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +7 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +7 -3
- package/node_modules/zod/v4/core/to-json-schema.js +8 -7
- package/node_modules/zod/v4/core/util.cjs +181 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +160 -143
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +31 -0
- package/node_modules/zod/v4/core/visit.js +12 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +1 -0
- package/node_modules/zod/v4/locales/ar.js +1 -0
- package/node_modules/zod/v4/locales/az.cjs +1 -0
- package/node_modules/zod/v4/locales/az.js +1 -0
- package/node_modules/zod/v4/locales/be.cjs +1 -0
- package/node_modules/zod/v4/locales/be.js +1 -0
- package/node_modules/zod/v4/locales/bg.cjs +1 -0
- package/node_modules/zod/v4/locales/bg.js +1 -0
- package/node_modules/zod/v4/locales/bn.cjs +1 -0
- package/node_modules/zod/v4/locales/bn.js +1 -0
- package/node_modules/zod/v4/locales/ca.cjs +1 -0
- package/node_modules/zod/v4/locales/ca.js +1 -0
- package/node_modules/zod/v4/locales/ckb.cjs +1 -0
- package/node_modules/zod/v4/locales/ckb.js +1 -0
- package/node_modules/zod/v4/locales/cs.cjs +1 -0
- package/node_modules/zod/v4/locales/cs.js +1 -0
- package/node_modules/zod/v4/locales/da.cjs +1 -0
- package/node_modules/zod/v4/locales/da.js +1 -0
- package/node_modules/zod/v4/locales/de.cjs +1 -0
- package/node_modules/zod/v4/locales/de.js +1 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +1 -0
- package/node_modules/zod/v4/locales/en.js +1 -0
- package/node_modules/zod/v4/locales/eo.cjs +1 -0
- package/node_modules/zod/v4/locales/eo.js +1 -0
- package/node_modules/zod/v4/locales/es.cjs +1 -0
- package/node_modules/zod/v4/locales/es.js +1 -0
- package/node_modules/zod/v4/locales/fa.cjs +1 -0
- package/node_modules/zod/v4/locales/fa.js +1 -0
- package/node_modules/zod/v4/locales/fi.cjs +1 -0
- package/node_modules/zod/v4/locales/fi.js +1 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +1 -0
- package/node_modules/zod/v4/locales/fr-CA.js +1 -0
- package/node_modules/zod/v4/locales/fr.cjs +1 -0
- package/node_modules/zod/v4/locales/fr.js +1 -0
- package/node_modules/zod/v4/locales/gu.cjs +1 -0
- package/node_modules/zod/v4/locales/gu.js +1 -0
- package/node_modules/zod/v4/locales/he.cjs +1 -0
- package/node_modules/zod/v4/locales/he.js +1 -0
- package/node_modules/zod/v4/locales/hi.cjs +1 -0
- package/node_modules/zod/v4/locales/hi.js +1 -0
- package/node_modules/zod/v4/locales/hr.cjs +1 -0
- package/node_modules/zod/v4/locales/hr.js +1 -0
- package/node_modules/zod/v4/locales/hu.cjs +1 -0
- package/node_modules/zod/v4/locales/hu.js +1 -0
- package/node_modules/zod/v4/locales/hy.cjs +1 -0
- package/node_modules/zod/v4/locales/hy.js +1 -0
- package/node_modules/zod/v4/locales/id.cjs +1 -0
- package/node_modules/zod/v4/locales/id.js +1 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +1 -0
- package/node_modules/zod/v4/locales/is.js +1 -0
- package/node_modules/zod/v4/locales/it.cjs +1 -0
- package/node_modules/zod/v4/locales/it.js +1 -0
- package/node_modules/zod/v4/locales/ja.cjs +1 -0
- package/node_modules/zod/v4/locales/ja.js +1 -0
- package/node_modules/zod/v4/locales/ka.cjs +1 -0
- package/node_modules/zod/v4/locales/ka.js +1 -0
- package/node_modules/zod/v4/locales/km.cjs +1 -0
- package/node_modules/zod/v4/locales/km.js +1 -0
- package/node_modules/zod/v4/locales/kn.cjs +1 -0
- package/node_modules/zod/v4/locales/kn.js +1 -0
- package/node_modules/zod/v4/locales/ko.cjs +1 -0
- package/node_modules/zod/v4/locales/ko.js +1 -0
- package/node_modules/zod/v4/locales/lt.cjs +1 -0
- package/node_modules/zod/v4/locales/lt.js +1 -0
- package/node_modules/zod/v4/locales/mk.cjs +1 -0
- package/node_modules/zod/v4/locales/mk.js +1 -0
- package/node_modules/zod/v4/locales/ms.cjs +1 -0
- package/node_modules/zod/v4/locales/ms.js +1 -0
- package/node_modules/zod/v4/locales/ne.cjs +1 -0
- package/node_modules/zod/v4/locales/ne.js +1 -0
- package/node_modules/zod/v4/locales/nl.cjs +1 -0
- package/node_modules/zod/v4/locales/nl.js +1 -0
- package/node_modules/zod/v4/locales/nn.cjs +1 -0
- package/node_modules/zod/v4/locales/nn.js +1 -0
- package/node_modules/zod/v4/locales/no.cjs +1 -0
- package/node_modules/zod/v4/locales/no.js +1 -0
- package/node_modules/zod/v4/locales/ota.cjs +1 -0
- package/node_modules/zod/v4/locales/ota.js +1 -0
- package/node_modules/zod/v4/locales/pl.cjs +1 -0
- package/node_modules/zod/v4/locales/pl.js +1 -0
- package/node_modules/zod/v4/locales/ps.cjs +1 -0
- package/node_modules/zod/v4/locales/ps.js +1 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +1 -0
- package/node_modules/zod/v4/locales/pt-BR.js +1 -0
- package/node_modules/zod/v4/locales/pt.cjs +1 -0
- package/node_modules/zod/v4/locales/pt.js +1 -0
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +1 -0
- package/node_modules/zod/v4/locales/ru.js +1 -0
- package/node_modules/zod/v4/locales/sk.cjs +1 -0
- package/node_modules/zod/v4/locales/sk.js +1 -0
- package/node_modules/zod/v4/locales/sl.cjs +1 -0
- package/node_modules/zod/v4/locales/sl.js +1 -0
- package/node_modules/zod/v4/locales/sv.cjs +1 -0
- package/node_modules/zod/v4/locales/sv.js +1 -0
- package/node_modules/zod/v4/locales/ta.cjs +1 -0
- package/node_modules/zod/v4/locales/ta.js +1 -0
- package/node_modules/zod/v4/locales/tg.cjs +143 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +116 -0
- package/node_modules/zod/v4/locales/th.cjs +1 -0
- package/node_modules/zod/v4/locales/th.js +1 -0
- package/node_modules/zod/v4/locales/tk.cjs +1 -0
- package/node_modules/zod/v4/locales/tk.js +1 -0
- package/node_modules/zod/v4/locales/tr.cjs +1 -0
- package/node_modules/zod/v4/locales/tr.js +1 -0
- package/node_modules/zod/v4/locales/uk.cjs +1 -0
- package/node_modules/zod/v4/locales/uk.js +1 -0
- package/node_modules/zod/v4/locales/ur.cjs +1 -0
- package/node_modules/zod/v4/locales/ur.js +1 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +1 -0
- package/node_modules/zod/v4/locales/vi.js +1 -0
- package/node_modules/zod/v4/locales/yo.cjs +1 -0
- package/node_modules/zod/v4/locales/yo.js +1 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-CN.js +1 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-TW.js +1 -0
- package/node_modules/zod/v4/mini/checks.cjs +20 -2
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +42 -4
- package/node_modules/zod/v4/mini/schemas.d.cts +9 -1
- package/node_modules/zod/v4/mini/schemas.d.ts +9 -1
- package/node_modules/zod/v4/mini/schemas.js +19 -2
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/package.json +2 -2
- package/slingshot/index.js +151 -149
- package/node_modules/@types/node/ffi.d.ts +0 -486
- package/node_modules/@types/node/inspector/promises.d.ts +0 -35
- package/node_modules/@types/node/path/posix.d.ts +0 -8
- package/node_modules/@types/node/path/win32.d.ts +0 -8
- package/node_modules/@types/node/quic.d.ts +0 -2151
- package/node_modules/@types/node/stream/iter.d.ts +0 -452
- package/node_modules/@types/node/test/reporters.d.ts +0 -59
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
- package/node_modules/@types/node/ts5.7/index.d.ts +0 -118
- package/node_modules/@types/node/util/types.d.ts +0 -558
- package/node_modules/@types/node/vfs.d.ts +0 -210
- package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
- package/node_modules/@types/node/web-globals/console.d.ts +0 -9
- package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
- package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
- package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
- package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
- package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
- package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
- package/node_modules/@types/node/web-globals/url.d.ts +0 -24
- package/node_modules/@types/node/zlib/iter.d.ts +0 -131
- package/node_modules/jose/dist/webapi/lib/base64.js +0 -20
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -27
- package/node_modules/jose/dist/webapi/lib/helpers.js +0 -45
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -12
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -10
- package/node_modules/jose/dist/webapi/lib/key_options.js +0 -8
- package/node_modules/jose/dist/webapi/lib/signing.js +0 -22
- package/node_modules/jose/dist/webapi/lib/type_checks.js +0 -30
- package/node_modules/undici-types/cache-interceptor.d.ts +0 -179
- package/node_modules/undici-types/client-stats.d.ts +0 -15
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +0 -7
- package/node_modules/undici-types/h2c-client.d.ts +0 -73
- package/node_modules/undici-types/mock-call-history.d.ts +0 -111
- package/node_modules/undici-types/round-robin-pool.d.ts +0 -39
- package/node_modules/undici-types/snapshot-agent.d.ts +0 -113
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +0 -25
- package/node_modules/undici-types/utility.d.ts +0 -7
|
@@ -1,28 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The `node:fs` module enables interacting with the file system in a
|
|
3
|
+
* way modeled on standard POSIX functions.
|
|
4
|
+
*
|
|
5
|
+
* To use the promise-based APIs:
|
|
6
|
+
*
|
|
7
|
+
* ```js
|
|
8
|
+
* import * as fs from 'node:fs/promises';
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* To use the callback and sync APIs:
|
|
12
|
+
*
|
|
13
|
+
* ```js
|
|
14
|
+
* import * as fs from 'node:fs';
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* All file system operations have synchronous, callback, and promise-based
|
|
18
|
+
* forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
|
|
19
|
+
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/fs.js)
|
|
20
|
+
*/
|
|
21
|
+
declare module "fs" {
|
|
22
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
5
23
|
import * as stream from "node:stream";
|
|
24
|
+
import { Abortable, EventEmitter } from "node:events";
|
|
6
25
|
import { URL } from "node:url";
|
|
26
|
+
import * as promises from "node:fs/promises";
|
|
27
|
+
export { promises };
|
|
7
28
|
/**
|
|
8
29
|
* Valid types for path values in "fs".
|
|
9
30
|
*/
|
|
10
|
-
type PathLike = string | Buffer | URL;
|
|
11
|
-
type PathOrFileDescriptor = PathLike | number;
|
|
12
|
-
type TimeLike = string | number | Date;
|
|
13
|
-
type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
|
|
14
|
-
type BufferEncodingOption =
|
|
31
|
+
export type PathLike = string | Buffer | URL;
|
|
32
|
+
export type PathOrFileDescriptor = PathLike | number;
|
|
33
|
+
export type TimeLike = string | number | Date;
|
|
34
|
+
export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
|
|
35
|
+
export type BufferEncodingOption =
|
|
15
36
|
| "buffer"
|
|
16
37
|
| {
|
|
17
38
|
encoding: "buffer";
|
|
18
39
|
};
|
|
19
|
-
interface ObjectEncodingOptions {
|
|
40
|
+
export interface ObjectEncodingOptions {
|
|
20
41
|
encoding?: BufferEncoding | null | undefined;
|
|
21
42
|
}
|
|
22
|
-
type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null;
|
|
23
|
-
type OpenMode = number | string;
|
|
24
|
-
type Mode = number | string;
|
|
25
|
-
interface StatsBase<T> {
|
|
43
|
+
export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null;
|
|
44
|
+
export type OpenMode = number | string;
|
|
45
|
+
export type Mode = number | string;
|
|
46
|
+
export interface StatsBase<T> {
|
|
26
47
|
isFile(): boolean;
|
|
27
48
|
isDirectory(): boolean;
|
|
28
49
|
isBlockDevice(): boolean;
|
|
@@ -48,15 +69,8 @@ declare module "node:fs" {
|
|
|
48
69
|
mtime: Date;
|
|
49
70
|
ctime: Date;
|
|
50
71
|
birthtime: Date;
|
|
51
|
-
// Deliberately not defining a type alias here... it'd be exported, and something in the ecosystem would inevitably start using it.
|
|
52
|
-
// TODO: replace with Temporal builtins once @types/node no longer supports TS <6.0.
|
|
53
|
-
atimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
|
|
54
|
-
mtimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
|
|
55
|
-
ctimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T : unknown;
|
|
56
|
-
birthtimeInstant: typeof globalThis extends { Temporal: { Instant: new(...args: any[]) => infer T } } ? T
|
|
57
|
-
: unknown;
|
|
58
72
|
}
|
|
59
|
-
interface Stats extends StatsBase<number> {}
|
|
73
|
+
export interface Stats extends StatsBase<number> {}
|
|
60
74
|
/**
|
|
61
75
|
* A `fs.Stats` object provides information about a file.
|
|
62
76
|
*
|
|
@@ -117,10 +131,10 @@ declare module "node:fs" {
|
|
|
117
131
|
* ```
|
|
118
132
|
* @since v0.1.21
|
|
119
133
|
*/
|
|
120
|
-
class Stats {
|
|
134
|
+
export class Stats {
|
|
121
135
|
private constructor();
|
|
122
136
|
}
|
|
123
|
-
interface StatsFsBase<T> {
|
|
137
|
+
export interface StatsFsBase<T> {
|
|
124
138
|
/** Type of file system. */
|
|
125
139
|
type: T;
|
|
126
140
|
/** Optimal transfer block size. */
|
|
@@ -133,12 +147,10 @@ declare module "node:fs" {
|
|
|
133
147
|
bavail: T;
|
|
134
148
|
/** Total file nodes in file system. */
|
|
135
149
|
files: T;
|
|
136
|
-
/** Fundamental file system block size. */
|
|
137
|
-
frsize: T;
|
|
138
150
|
/** Free file nodes in file system. */
|
|
139
151
|
ffree: T;
|
|
140
152
|
}
|
|
141
|
-
interface StatsFs extends StatsFsBase<number> {}
|
|
153
|
+
export interface StatsFs extends StatsFsBase<number> {}
|
|
142
154
|
/**
|
|
143
155
|
* Provides information about a mounted file system.
|
|
144
156
|
*
|
|
@@ -173,9 +185,9 @@ declare module "node:fs" {
|
|
|
173
185
|
* ```
|
|
174
186
|
* @since v19.6.0, v18.15.0
|
|
175
187
|
*/
|
|
176
|
-
class StatsFs {}
|
|
177
|
-
interface BigIntStatsFs extends StatsFsBase<bigint> {}
|
|
178
|
-
interface StatFsOptions {
|
|
188
|
+
export class StatsFs {}
|
|
189
|
+
export interface BigIntStatsFs extends StatsFsBase<bigint> {}
|
|
190
|
+
export interface StatFsOptions {
|
|
179
191
|
bigint?: boolean | undefined;
|
|
180
192
|
}
|
|
181
193
|
/**
|
|
@@ -187,7 +199,7 @@ declare module "node:fs" {
|
|
|
187
199
|
* the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
|
|
188
200
|
* @since v10.10.0
|
|
189
201
|
*/
|
|
190
|
-
class Dirent<Name extends string | Buffer = string> {
|
|
202
|
+
export class Dirent<Name extends string | Buffer = string> {
|
|
191
203
|
/**
|
|
192
204
|
* Returns `true` if the `fs.Dirent` object describes a regular file.
|
|
193
205
|
* @since v10.10.0
|
|
@@ -236,6 +248,12 @@ declare module "node:fs" {
|
|
|
236
248
|
* @since v20.12.0, v18.20.0
|
|
237
249
|
*/
|
|
238
250
|
parentPath: string;
|
|
251
|
+
/**
|
|
252
|
+
* Alias for `dirent.parentPath`.
|
|
253
|
+
* @since v20.1.0
|
|
254
|
+
* @deprecated Since v20.12.0
|
|
255
|
+
*/
|
|
256
|
+
path: string;
|
|
239
257
|
}
|
|
240
258
|
/**
|
|
241
259
|
* A class representing a directory stream.
|
|
@@ -258,7 +276,7 @@ declare module "node:fs" {
|
|
|
258
276
|
* closed after the iterator exits.
|
|
259
277
|
* @since v12.12.0
|
|
260
278
|
*/
|
|
261
|
-
class Dir implements AsyncIterable<Dirent> {
|
|
279
|
+
export class Dir implements AsyncIterable<Dirent> {
|
|
262
280
|
/**
|
|
263
281
|
* The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`.
|
|
264
282
|
* @since v12.12.0
|
|
@@ -314,13 +332,15 @@ declare module "node:fs" {
|
|
|
314
332
|
/**
|
|
315
333
|
* Calls `dir.close()` if the directory handle is open, and returns a promise that
|
|
316
334
|
* fulfills when disposal is complete.
|
|
317
|
-
* @since
|
|
335
|
+
* @since v22.17.0
|
|
336
|
+
* @experimental
|
|
318
337
|
*/
|
|
319
338
|
[Symbol.asyncDispose](): Promise<void>;
|
|
320
339
|
/**
|
|
321
340
|
* Calls `dir.closeSync()` if the directory handle is open, and returns
|
|
322
341
|
* `undefined`.
|
|
323
|
-
* @since
|
|
342
|
+
* @since v22.17.0
|
|
343
|
+
* @experimental
|
|
324
344
|
*/
|
|
325
345
|
[Symbol.dispose](): void;
|
|
326
346
|
}
|
|
@@ -330,7 +350,7 @@ declare module "node:fs" {
|
|
|
330
350
|
* Extends `EventEmitter`
|
|
331
351
|
* A successful call to {@link watchFile} method will return a new fs.StatWatcher object.
|
|
332
352
|
*/
|
|
333
|
-
interface StatWatcher extends EventEmitter {
|
|
353
|
+
export interface StatWatcher extends EventEmitter {
|
|
334
354
|
/**
|
|
335
355
|
* When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have
|
|
336
356
|
* no effect.
|
|
@@ -351,12 +371,7 @@ declare module "node:fs" {
|
|
|
351
371
|
*/
|
|
352
372
|
unref(): this;
|
|
353
373
|
}
|
|
354
|
-
interface
|
|
355
|
-
"change": [eventType: string, filename: string | NonSharedBuffer];
|
|
356
|
-
"close": [];
|
|
357
|
-
"error": [error: Error];
|
|
358
|
-
}
|
|
359
|
-
interface FSWatcher extends InternalEventEmitter<FSWatcherEventMap> {
|
|
374
|
+
export interface FSWatcher extends EventEmitter {
|
|
360
375
|
/**
|
|
361
376
|
* Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable.
|
|
362
377
|
* @since v0.5.8
|
|
@@ -381,19 +396,44 @@ declare module "node:fs" {
|
|
|
381
396
|
* @since v14.3.0, v12.20.0
|
|
382
397
|
*/
|
|
383
398
|
unref(): this;
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
399
|
+
/**
|
|
400
|
+
* events.EventEmitter
|
|
401
|
+
* 1. change
|
|
402
|
+
* 2. close
|
|
403
|
+
* 3. error
|
|
404
|
+
*/
|
|
405
|
+
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
406
|
+
addListener(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this;
|
|
407
|
+
addListener(event: "close", listener: () => void): this;
|
|
408
|
+
addListener(event: "error", listener: (error: Error) => void): this;
|
|
409
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
410
|
+
on(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this;
|
|
411
|
+
on(event: "close", listener: () => void): this;
|
|
412
|
+
on(event: "error", listener: (error: Error) => void): this;
|
|
413
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
414
|
+
once(event: "change", listener: (eventType: string, filename: string | NonSharedBuffer) => void): this;
|
|
415
|
+
once(event: "close", listener: () => void): this;
|
|
416
|
+
once(event: "error", listener: (error: Error) => void): this;
|
|
417
|
+
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
418
|
+
prependListener(
|
|
419
|
+
event: "change",
|
|
420
|
+
listener: (eventType: string, filename: string | NonSharedBuffer) => void,
|
|
421
|
+
): this;
|
|
422
|
+
prependListener(event: "close", listener: () => void): this;
|
|
423
|
+
prependListener(event: "error", listener: (error: Error) => void): this;
|
|
424
|
+
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
425
|
+
prependOnceListener(
|
|
426
|
+
event: "change",
|
|
427
|
+
listener: (eventType: string, filename: string | NonSharedBuffer) => void,
|
|
428
|
+
): this;
|
|
429
|
+
prependOnceListener(event: "close", listener: () => void): this;
|
|
430
|
+
prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
|
390
431
|
}
|
|
391
432
|
/**
|
|
392
|
-
* Instances of `fs.ReadStream`
|
|
393
|
-
* returned using the `fs.createReadStream()` function.
|
|
433
|
+
* Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function.
|
|
394
434
|
* @since v0.1.93
|
|
395
435
|
*/
|
|
396
|
-
class ReadStream extends stream.Readable {
|
|
436
|
+
export class ReadStream extends stream.Readable {
|
|
397
437
|
close(callback?: (err?: NodeJS.ErrnoException | null) => void): void;
|
|
398
438
|
/**
|
|
399
439
|
* The number of bytes that have been read so far.
|
|
@@ -413,251 +453,60 @@ declare module "node:fs" {
|
|
|
413
453
|
* @since v11.2.0, v10.16.0
|
|
414
454
|
*/
|
|
415
455
|
pending: boolean;
|
|
416
|
-
// #region InternalEventEmitter
|
|
417
|
-
addListener<E extends keyof ReadStreamEventMap>(
|
|
418
|
-
eventName: E,
|
|
419
|
-
listener: (...args: ReadStreamEventMap[E]) => void,
|
|
420
|
-
): this;
|
|
421
|
-
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
422
|
-
emit<E extends keyof ReadStreamEventMap>(eventName: E, ...args: ReadStreamEventMap[E]): boolean;
|
|
423
|
-
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
424
|
-
listenerCount<E extends keyof ReadStreamEventMap>(
|
|
425
|
-
eventName: E,
|
|
426
|
-
listener?: (...args: ReadStreamEventMap[E]) => void,
|
|
427
|
-
): number;
|
|
428
|
-
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
429
|
-
listeners<E extends keyof ReadStreamEventMap>(eventName: E): ((...args: ReadStreamEventMap[E]) => void)[];
|
|
430
|
-
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
431
|
-
off<E extends keyof ReadStreamEventMap>(eventName: E, listener: (...args: ReadStreamEventMap[E]) => void): this;
|
|
432
|
-
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
433
|
-
on<E extends keyof ReadStreamEventMap>(eventName: E, listener: (...args: ReadStreamEventMap[E]) => void): this;
|
|
434
|
-
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
435
|
-
once<E extends keyof ReadStreamEventMap>(
|
|
436
|
-
eventName: E,
|
|
437
|
-
listener: (...args: ReadStreamEventMap[E]) => void,
|
|
438
|
-
): this;
|
|
439
|
-
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
440
|
-
prependListener<E extends keyof ReadStreamEventMap>(
|
|
441
|
-
eventName: E,
|
|
442
|
-
listener: (...args: ReadStreamEventMap[E]) => void,
|
|
443
|
-
): this;
|
|
444
|
-
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
445
|
-
prependOnceListener<E extends keyof ReadStreamEventMap>(
|
|
446
|
-
eventName: E,
|
|
447
|
-
listener: (...args: ReadStreamEventMap[E]) => void,
|
|
448
|
-
): this;
|
|
449
|
-
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
450
|
-
rawListeners<E extends keyof ReadStreamEventMap>(eventName: E): ((...args: ReadStreamEventMap[E]) => void)[];
|
|
451
|
-
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
452
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
453
|
-
removeAllListeners<E extends keyof ReadStreamEventMap>(eventName?: E): this;
|
|
454
|
-
removeAllListeners(eventName?: string | symbol): this;
|
|
455
|
-
removeListener<E extends keyof ReadStreamEventMap>(
|
|
456
|
-
eventName: E,
|
|
457
|
-
listener: (...args: ReadStreamEventMap[E]) => void,
|
|
458
|
-
): this;
|
|
459
|
-
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
460
|
-
// #endregion
|
|
461
|
-
}
|
|
462
|
-
interface Utf8StreamOptions {
|
|
463
|
-
/**
|
|
464
|
-
* Appends writes to dest file instead of truncating it.
|
|
465
|
-
* @default true
|
|
466
|
-
*/
|
|
467
|
-
append?: boolean | undefined;
|
|
468
|
-
/**
|
|
469
|
-
* Which type of data you can send to the write
|
|
470
|
-
* function, supported values are `'utf8'` or `'buffer'`.
|
|
471
|
-
* @default 'utf8'
|
|
472
|
-
*/
|
|
473
|
-
contentMode?: "utf8" | "buffer" | undefined;
|
|
474
|
-
/**
|
|
475
|
-
* A path to a file to be written to (mode controlled by the
|
|
476
|
-
* append option).
|
|
477
|
-
*/
|
|
478
|
-
dest?: string | undefined;
|
|
479
|
-
/**
|
|
480
|
-
* A file descriptor, something that is returned by `fs.open()`
|
|
481
|
-
* or `fs.openSync()`.
|
|
482
|
-
*/
|
|
483
|
-
fd?: number | undefined;
|
|
484
|
-
/**
|
|
485
|
-
* An object that has the same API as the `fs` module, useful
|
|
486
|
-
* for mocking, testing, or customizing the behavior of the stream.
|
|
487
|
-
*/
|
|
488
|
-
fs?: object | undefined;
|
|
489
|
-
/**
|
|
490
|
-
* Perform a `fs.fsyncSync()` every time a write is
|
|
491
|
-
* completed.
|
|
492
|
-
*/
|
|
493
|
-
fsync?: boolean | undefined;
|
|
494
|
-
/**
|
|
495
|
-
* The maximum length of the internal buffer. If a write
|
|
496
|
-
* operation would cause the buffer to exceed `maxLength`, the data written is
|
|
497
|
-
* dropped and a drop event is emitted with the dropped data
|
|
498
|
-
*/
|
|
499
|
-
maxLength?: number | undefined;
|
|
500
|
-
/**
|
|
501
|
-
* The maximum number of bytes that can be written;
|
|
502
|
-
* @default 16384
|
|
503
|
-
*/
|
|
504
|
-
maxWrite?: number | undefined;
|
|
505
|
-
/**
|
|
506
|
-
* The minimum length of the internal buffer that is
|
|
507
|
-
* required to be full before flushing.
|
|
508
|
-
*/
|
|
509
|
-
minLength?: number | undefined;
|
|
510
|
-
/**
|
|
511
|
-
* Ensure directory for `dest` file exists when true.
|
|
512
|
-
* @default false
|
|
513
|
-
*/
|
|
514
|
-
mkdir?: boolean | undefined;
|
|
515
|
-
/**
|
|
516
|
-
* Specify the creating file mode (see `fs.open()`).
|
|
517
|
-
*/
|
|
518
|
-
mode?: number | string | undefined;
|
|
519
456
|
/**
|
|
520
|
-
*
|
|
457
|
+
* events.EventEmitter
|
|
458
|
+
* 1. open
|
|
459
|
+
* 2. close
|
|
460
|
+
* 3. ready
|
|
521
461
|
*/
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
* will bubble the error. The `err` is the error that caused this function to
|
|
528
|
-
* be called, `writeBufferLen` is the length of the buffer that was written,
|
|
529
|
-
* and `remainingBufferLen` is the length of the remaining buffer that the
|
|
530
|
-
* stream did not try to write.
|
|
531
|
-
*/
|
|
532
|
-
retryEAGAIN?: ((err: Error | null, writeBufferLen: number, remainingBufferLen: number) => boolean) | undefined;
|
|
533
|
-
/**
|
|
534
|
-
* Perform writes synchronously.
|
|
535
|
-
*/
|
|
536
|
-
sync?: boolean | undefined;
|
|
537
|
-
}
|
|
538
|
-
interface Utf8StreamEventMap {
|
|
539
|
-
"close": [];
|
|
540
|
-
"drain": [];
|
|
541
|
-
"drop": [data: string | Buffer];
|
|
542
|
-
"error": [error: Error];
|
|
543
|
-
"finish": [];
|
|
544
|
-
"ready": [];
|
|
545
|
-
"write": [n: number];
|
|
462
|
+
addListener<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
|
|
463
|
+
on<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
|
|
464
|
+
once<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
|
|
465
|
+
prependListener<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
|
|
466
|
+
prependOnceListener<K extends keyof ReadStreamEvents>(event: K, listener: ReadStreamEvents[K]): this;
|
|
546
467
|
}
|
|
468
|
+
|
|
547
469
|
/**
|
|
548
|
-
*
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
470
|
+
* The Keys are events of the ReadStream and the values are the functions that are called when the event is emitted.
|
|
471
|
+
*/
|
|
472
|
+
type ReadStreamEvents = {
|
|
473
|
+
close: () => void;
|
|
474
|
+
data: (chunk: Buffer | string) => void;
|
|
475
|
+
end: () => void;
|
|
476
|
+
error: (err: Error) => void;
|
|
477
|
+
open: (fd: number) => void;
|
|
478
|
+
pause: () => void;
|
|
479
|
+
readable: () => void;
|
|
480
|
+
ready: () => void;
|
|
481
|
+
resume: () => void;
|
|
482
|
+
} & CustomEvents;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* string & {} allows to allow any kind of strings for the event
|
|
486
|
+
* but still allows to have auto completion for the normal events.
|
|
553
487
|
*/
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
destroy(): void;
|
|
570
|
-
/**
|
|
571
|
-
* Close the stream gracefully, flushing the internal buffer before closing.
|
|
572
|
-
*/
|
|
573
|
-
end(): void;
|
|
574
|
-
/**
|
|
575
|
-
* The file descriptor that is being written to.
|
|
576
|
-
*/
|
|
577
|
-
readonly fd: number;
|
|
578
|
-
/**
|
|
579
|
-
* The file that is being written to.
|
|
580
|
-
*/
|
|
581
|
-
readonly file: string;
|
|
582
|
-
/**
|
|
583
|
-
* Writes the current buffer to the file if a write was not in progress. Do
|
|
584
|
-
* nothing if `minLength` is zero or if it is already writing.
|
|
585
|
-
*/
|
|
586
|
-
flush(callback: (err: Error | null) => void): void;
|
|
587
|
-
/**
|
|
588
|
-
* Flushes the buffered data synchronously. This is a costly operation.
|
|
589
|
-
*/
|
|
590
|
-
flushSync(): void;
|
|
591
|
-
/**
|
|
592
|
-
* Whether the stream is performing a `fs.fsyncSync()` after every
|
|
593
|
-
* write operation.
|
|
594
|
-
*/
|
|
595
|
-
readonly fsync: boolean;
|
|
596
|
-
/**
|
|
597
|
-
* The maximum length of the internal buffer. If a write
|
|
598
|
-
* operation would cause the buffer to exceed `maxLength`, the data written is
|
|
599
|
-
* dropped and a drop event is emitted with the dropped data.
|
|
600
|
-
*/
|
|
601
|
-
readonly maxLength: number;
|
|
602
|
-
/**
|
|
603
|
-
* The minimum length of the internal buffer that is required to be
|
|
604
|
-
* full before flushing.
|
|
605
|
-
*/
|
|
606
|
-
readonly minLength: number;
|
|
607
|
-
/**
|
|
608
|
-
* Whether the stream should ensure that the directory for the
|
|
609
|
-
* `dest` file exists. If `true`, it will create the directory if it does not
|
|
610
|
-
* exist.
|
|
611
|
-
* @default false
|
|
612
|
-
*/
|
|
613
|
-
readonly mkdir: boolean;
|
|
614
|
-
/**
|
|
615
|
-
* The mode of the file that is being written to.
|
|
616
|
-
*/
|
|
617
|
-
readonly mode: number | string;
|
|
618
|
-
/**
|
|
619
|
-
* The number of milliseconds between flushes. If set to `0`, no
|
|
620
|
-
* periodic flushes will be performed.
|
|
621
|
-
*/
|
|
622
|
-
readonly periodicFlush: number;
|
|
623
|
-
/**
|
|
624
|
-
* Reopen the file in place, useful for log rotation.
|
|
625
|
-
* @param file A path to a file to be written to (mode
|
|
626
|
-
* controlled by the append option).
|
|
627
|
-
*/
|
|
628
|
-
reopen(file: PathLike): void;
|
|
629
|
-
/**
|
|
630
|
-
* Whether the stream is writing synchronously or asynchronously.
|
|
631
|
-
*/
|
|
632
|
-
readonly sync: boolean;
|
|
633
|
-
/**
|
|
634
|
-
* When the `options.contentMode` is set to `'utf8'` when the stream is created,
|
|
635
|
-
* the `data` argument must be a string. If the `contentMode` is set to `'buffer'`,
|
|
636
|
-
* the `data` argument must be a `Buffer`.
|
|
637
|
-
* @param data The data to write.
|
|
638
|
-
*/
|
|
639
|
-
write(data: string | Buffer): boolean;
|
|
640
|
-
/**
|
|
641
|
-
* Whether the stream is currently writing data to the file.
|
|
642
|
-
*/
|
|
643
|
-
readonly writing: boolean;
|
|
644
|
-
/**
|
|
645
|
-
* Calls `utf8Stream.destroy()`.
|
|
646
|
-
*/
|
|
647
|
-
[Symbol.dispose](): void;
|
|
648
|
-
}
|
|
649
|
-
interface Utf8Stream extends InternalEventEmitter<Utf8StreamEventMap> {}
|
|
650
|
-
interface WriteStreamEventMap extends stream.WritableEventMap {
|
|
651
|
-
"close": [];
|
|
652
|
-
"open": [fd: number];
|
|
653
|
-
"ready": [];
|
|
654
|
-
}
|
|
488
|
+
type CustomEvents = { [Key in string & {} | symbol]: (...args: any[]) => void };
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* The Keys are events of the WriteStream and the values are the functions that are called when the event is emitted.
|
|
492
|
+
*/
|
|
493
|
+
type WriteStreamEvents = {
|
|
494
|
+
close: () => void;
|
|
495
|
+
drain: () => void;
|
|
496
|
+
error: (err: Error) => void;
|
|
497
|
+
finish: () => void;
|
|
498
|
+
open: (fd: number) => void;
|
|
499
|
+
pipe: (src: stream.Readable) => void;
|
|
500
|
+
ready: () => void;
|
|
501
|
+
unpipe: (src: stream.Readable) => void;
|
|
502
|
+
} & CustomEvents;
|
|
655
503
|
/**
|
|
656
|
-
*
|
|
657
|
-
*
|
|
504
|
+
* * Extends `stream.Writable`
|
|
505
|
+
*
|
|
506
|
+
* Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function.
|
|
658
507
|
* @since v0.1.93
|
|
659
508
|
*/
|
|
660
|
-
class WriteStream extends stream.Writable {
|
|
509
|
+
export class WriteStream extends stream.Writable {
|
|
661
510
|
/**
|
|
662
511
|
* Closes `writeStream`. Optionally accepts a
|
|
663
512
|
* callback that will be executed once the `writeStream`is closed.
|
|
@@ -683,57 +532,17 @@ declare module "node:fs" {
|
|
|
683
532
|
* @since v11.2.0
|
|
684
533
|
*/
|
|
685
534
|
pending: boolean;
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
): number;
|
|
698
|
-
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
699
|
-
listeners<E extends keyof WriteStreamEventMap>(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[];
|
|
700
|
-
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
701
|
-
off<E extends keyof WriteStreamEventMap>(
|
|
702
|
-
eventName: E,
|
|
703
|
-
listener: (...args: WriteStreamEventMap[E]) => void,
|
|
704
|
-
): this;
|
|
705
|
-
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
706
|
-
on<E extends keyof WriteStreamEventMap>(
|
|
707
|
-
eventName: E,
|
|
708
|
-
listener: (...args: WriteStreamEventMap[E]) => void,
|
|
709
|
-
): this;
|
|
710
|
-
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
711
|
-
once<E extends keyof WriteStreamEventMap>(
|
|
712
|
-
eventName: E,
|
|
713
|
-
listener: (...args: WriteStreamEventMap[E]) => void,
|
|
714
|
-
): this;
|
|
715
|
-
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
716
|
-
prependListener<E extends keyof WriteStreamEventMap>(
|
|
717
|
-
eventName: E,
|
|
718
|
-
listener: (...args: WriteStreamEventMap[E]) => void,
|
|
719
|
-
): this;
|
|
720
|
-
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
721
|
-
prependOnceListener<E extends keyof WriteStreamEventMap>(
|
|
722
|
-
eventName: E,
|
|
723
|
-
listener: (...args: WriteStreamEventMap[E]) => void,
|
|
724
|
-
): this;
|
|
725
|
-
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
726
|
-
rawListeners<E extends keyof WriteStreamEventMap>(eventName: E): ((...args: WriteStreamEventMap[E]) => void)[];
|
|
727
|
-
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
728
|
-
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
729
|
-
removeAllListeners<E extends keyof WriteStreamEventMap>(eventName?: E): this;
|
|
730
|
-
removeAllListeners(eventName?: string | symbol): this;
|
|
731
|
-
removeListener<E extends keyof WriteStreamEventMap>(
|
|
732
|
-
eventName: E,
|
|
733
|
-
listener: (...args: WriteStreamEventMap[E]) => void,
|
|
734
|
-
): this;
|
|
735
|
-
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
736
|
-
// #endregion
|
|
535
|
+
/**
|
|
536
|
+
* events.EventEmitter
|
|
537
|
+
* 1. open
|
|
538
|
+
* 2. close
|
|
539
|
+
* 3. ready
|
|
540
|
+
*/
|
|
541
|
+
addListener<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
|
|
542
|
+
on<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
|
|
543
|
+
once<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
|
|
544
|
+
prependListener<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
|
|
545
|
+
prependOnceListener<K extends keyof WriteStreamEvents>(event: K, listener: WriteStreamEvents[K]): this;
|
|
737
546
|
}
|
|
738
547
|
/**
|
|
739
548
|
* Asynchronously rename file at `oldPath` to the pathname provided
|
|
@@ -754,8 +563,8 @@ declare module "node:fs" {
|
|
|
754
563
|
* ```
|
|
755
564
|
* @since v0.0.2
|
|
756
565
|
*/
|
|
757
|
-
function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
|
|
758
|
-
namespace rename {
|
|
566
|
+
export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
|
|
567
|
+
export namespace rename {
|
|
759
568
|
/**
|
|
760
569
|
* Asynchronous rename(2) - Change the name or location of a file or directory.
|
|
761
570
|
* @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -771,7 +580,7 @@ declare module "node:fs" {
|
|
|
771
580
|
* See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details.
|
|
772
581
|
* @since v0.1.21
|
|
773
582
|
*/
|
|
774
|
-
function renameSync(oldPath: PathLike, newPath: PathLike): void;
|
|
583
|
+
export function renameSync(oldPath: PathLike, newPath: PathLike): void;
|
|
775
584
|
/**
|
|
776
585
|
* Truncates the file. No arguments other than a possible exception are
|
|
777
586
|
* given to the completion callback. A file descriptor can also be passed as the
|
|
@@ -793,13 +602,13 @@ declare module "node:fs" {
|
|
|
793
602
|
* @since v0.8.6
|
|
794
603
|
* @param [len=0]
|
|
795
604
|
*/
|
|
796
|
-
function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void;
|
|
605
|
+
export function truncate(path: PathLike, len: number | undefined, callback: NoParamCallback): void;
|
|
797
606
|
/**
|
|
798
607
|
* Asynchronous truncate(2) - Truncate a file to a specified length.
|
|
799
608
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
800
609
|
*/
|
|
801
|
-
function truncate(path: PathLike, callback: NoParamCallback): void;
|
|
802
|
-
namespace truncate {
|
|
610
|
+
export function truncate(path: PathLike, callback: NoParamCallback): void;
|
|
611
|
+
export namespace truncate {
|
|
803
612
|
/**
|
|
804
613
|
* Asynchronous truncate(2) - Truncate a file to a specified length.
|
|
805
614
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -816,7 +625,7 @@ declare module "node:fs" {
|
|
|
816
625
|
* @since v0.8.6
|
|
817
626
|
* @param [len=0]
|
|
818
627
|
*/
|
|
819
|
-
function truncateSync(path: PathLike, len?: number): void;
|
|
628
|
+
export function truncateSync(path: PathLike, len?: number): void;
|
|
820
629
|
/**
|
|
821
630
|
* Truncates the file descriptor. No arguments other than a possible exception are
|
|
822
631
|
* given to the completion callback.
|
|
@@ -860,13 +669,13 @@ declare module "node:fs" {
|
|
|
860
669
|
* @since v0.8.6
|
|
861
670
|
* @param [len=0]
|
|
862
671
|
*/
|
|
863
|
-
function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void;
|
|
672
|
+
export function ftruncate(fd: number, len: number | undefined, callback: NoParamCallback): void;
|
|
864
673
|
/**
|
|
865
674
|
* Asynchronous ftruncate(2) - Truncate a file to a specified length.
|
|
866
675
|
* @param fd A file descriptor.
|
|
867
676
|
*/
|
|
868
|
-
function ftruncate(fd: number, callback: NoParamCallback): void;
|
|
869
|
-
namespace ftruncate {
|
|
677
|
+
export function ftruncate(fd: number, callback: NoParamCallback): void;
|
|
678
|
+
export namespace ftruncate {
|
|
870
679
|
/**
|
|
871
680
|
* Asynchronous ftruncate(2) - Truncate a file to a specified length.
|
|
872
681
|
* @param fd A file descriptor.
|
|
@@ -882,7 +691,7 @@ declare module "node:fs" {
|
|
|
882
691
|
* @since v0.8.6
|
|
883
692
|
* @param [len=0]
|
|
884
693
|
*/
|
|
885
|
-
function ftruncateSync(fd: number, len?: number): void;
|
|
694
|
+
export function ftruncateSync(fd: number, len?: number): void;
|
|
886
695
|
/**
|
|
887
696
|
* Asynchronously changes owner and group of a file. No arguments other than a
|
|
888
697
|
* possible exception are given to the completion callback.
|
|
@@ -890,8 +699,8 @@ declare module "node:fs" {
|
|
|
890
699
|
* See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.
|
|
891
700
|
* @since v0.1.97
|
|
892
701
|
*/
|
|
893
|
-
function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
|
|
894
|
-
namespace chown {
|
|
702
|
+
export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
|
|
703
|
+
export namespace chown {
|
|
895
704
|
/**
|
|
896
705
|
* Asynchronous chown(2) - Change ownership of a file.
|
|
897
706
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -905,7 +714,7 @@ declare module "node:fs" {
|
|
|
905
714
|
* See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail.
|
|
906
715
|
* @since v0.1.97
|
|
907
716
|
*/
|
|
908
|
-
function chownSync(path: PathLike, uid: number, gid: number): void;
|
|
717
|
+
export function chownSync(path: PathLike, uid: number, gid: number): void;
|
|
909
718
|
/**
|
|
910
719
|
* Sets the owner of the file. No arguments other than a possible exception are
|
|
911
720
|
* given to the completion callback.
|
|
@@ -913,8 +722,8 @@ declare module "node:fs" {
|
|
|
913
722
|
* See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail.
|
|
914
723
|
* @since v0.4.7
|
|
915
724
|
*/
|
|
916
|
-
function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void;
|
|
917
|
-
namespace fchown {
|
|
725
|
+
export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void;
|
|
726
|
+
export namespace fchown {
|
|
918
727
|
/**
|
|
919
728
|
* Asynchronous fchown(2) - Change ownership of a file.
|
|
920
729
|
* @param fd A file descriptor.
|
|
@@ -929,15 +738,15 @@ declare module "node:fs" {
|
|
|
929
738
|
* @param uid The file's new owner's user id.
|
|
930
739
|
* @param gid The file's new group's group id.
|
|
931
740
|
*/
|
|
932
|
-
function fchownSync(fd: number, uid: number, gid: number): void;
|
|
741
|
+
export function fchownSync(fd: number, uid: number, gid: number): void;
|
|
933
742
|
/**
|
|
934
743
|
* Set the owner of the symbolic link. No arguments other than a possible
|
|
935
744
|
* exception are given to the completion callback.
|
|
936
745
|
*
|
|
937
746
|
* See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail.
|
|
938
747
|
*/
|
|
939
|
-
function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
|
|
940
|
-
namespace lchown {
|
|
748
|
+
export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
|
|
749
|
+
export namespace lchown {
|
|
941
750
|
/**
|
|
942
751
|
* Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
|
|
943
752
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -951,7 +760,7 @@ declare module "node:fs" {
|
|
|
951
760
|
* @param uid The file's new owner's user id.
|
|
952
761
|
* @param gid The file's new group's group id.
|
|
953
762
|
*/
|
|
954
|
-
function lchownSync(path: PathLike, uid: number, gid: number): void;
|
|
763
|
+
export function lchownSync(path: PathLike, uid: number, gid: number): void;
|
|
955
764
|
/**
|
|
956
765
|
* Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic
|
|
957
766
|
* link, then the link is not dereferenced: instead, the timestamps of the
|
|
@@ -961,8 +770,8 @@ declare module "node:fs" {
|
|
|
961
770
|
* callback.
|
|
962
771
|
* @since v14.5.0, v12.19.0
|
|
963
772
|
*/
|
|
964
|
-
function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
|
|
965
|
-
namespace lutimes {
|
|
773
|
+
export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
|
|
774
|
+
export namespace lutimes {
|
|
966
775
|
/**
|
|
967
776
|
* Changes the access and modification times of a file in the same way as `fsPromises.utimes()`,
|
|
968
777
|
* with the difference that if the path refers to a symbolic link, then the link is not
|
|
@@ -979,7 +788,7 @@ declare module "node:fs" {
|
|
|
979
788
|
* the operation fails. This is the synchronous version of {@link lutimes}.
|
|
980
789
|
* @since v14.5.0, v12.19.0
|
|
981
790
|
*/
|
|
982
|
-
function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
|
|
791
|
+
export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
|
|
983
792
|
/**
|
|
984
793
|
* Asynchronously changes the permissions of a file. No arguments other than a
|
|
985
794
|
* possible exception are given to the completion callback.
|
|
@@ -996,8 +805,8 @@ declare module "node:fs" {
|
|
|
996
805
|
* ```
|
|
997
806
|
* @since v0.1.30
|
|
998
807
|
*/
|
|
999
|
-
function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
|
|
1000
|
-
namespace chmod {
|
|
808
|
+
export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
|
|
809
|
+
export namespace chmod {
|
|
1001
810
|
/**
|
|
1002
811
|
* Asynchronous chmod(2) - Change permissions of a file.
|
|
1003
812
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1012,7 +821,7 @@ declare module "node:fs" {
|
|
|
1012
821
|
* See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail.
|
|
1013
822
|
* @since v0.6.7
|
|
1014
823
|
*/
|
|
1015
|
-
function chmodSync(path: PathLike, mode: Mode): void;
|
|
824
|
+
export function chmodSync(path: PathLike, mode: Mode): void;
|
|
1016
825
|
/**
|
|
1017
826
|
* Sets the permissions on the file. No arguments other than a possible exception
|
|
1018
827
|
* are given to the completion callback.
|
|
@@ -1020,8 +829,8 @@ declare module "node:fs" {
|
|
|
1020
829
|
* See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.
|
|
1021
830
|
* @since v0.4.7
|
|
1022
831
|
*/
|
|
1023
|
-
function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void;
|
|
1024
|
-
namespace fchmod {
|
|
832
|
+
export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void;
|
|
833
|
+
export namespace fchmod {
|
|
1025
834
|
/**
|
|
1026
835
|
* Asynchronous fchmod(2) - Change permissions of a file.
|
|
1027
836
|
* @param fd A file descriptor.
|
|
@@ -1035,7 +844,7 @@ declare module "node:fs" {
|
|
|
1035
844
|
* See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail.
|
|
1036
845
|
* @since v0.4.7
|
|
1037
846
|
*/
|
|
1038
|
-
function fchmodSync(fd: number, mode: Mode): void;
|
|
847
|
+
export function fchmodSync(fd: number, mode: Mode): void;
|
|
1039
848
|
/**
|
|
1040
849
|
* Changes the permissions on a symbolic link. No arguments other than a possible
|
|
1041
850
|
* exception are given to the completion callback.
|
|
@@ -1045,9 +854,9 @@ declare module "node:fs" {
|
|
|
1045
854
|
* See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.
|
|
1046
855
|
* @deprecated Since v0.4.7
|
|
1047
856
|
*/
|
|
1048
|
-
function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
|
|
857
|
+
export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
|
|
1049
858
|
/** @deprecated */
|
|
1050
|
-
namespace lchmod {
|
|
859
|
+
export namespace lchmod {
|
|
1051
860
|
/**
|
|
1052
861
|
* Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
|
|
1053
862
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1063,7 +872,7 @@ declare module "node:fs" {
|
|
|
1063
872
|
* See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail.
|
|
1064
873
|
* @deprecated Since v0.4.7
|
|
1065
874
|
*/
|
|
1066
|
-
function lchmodSync(path: PathLike, mode: Mode): void;
|
|
875
|
+
export function lchmodSync(path: PathLike, mode: Mode): void;
|
|
1067
876
|
/**
|
|
1068
877
|
* Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object.
|
|
1069
878
|
*
|
|
@@ -1149,98 +958,48 @@ declare module "node:fs" {
|
|
|
1149
958
|
* ```
|
|
1150
959
|
* @since v0.0.2
|
|
1151
960
|
*/
|
|
1152
|
-
function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
1153
|
-
function stat(
|
|
961
|
+
export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
962
|
+
export function stat(
|
|
1154
963
|
path: PathLike,
|
|
1155
964
|
options:
|
|
1156
965
|
| (StatOptions & {
|
|
1157
966
|
bigint?: false | undefined;
|
|
1158
|
-
throwIfNoEntry?: true | undefined;
|
|
1159
967
|
})
|
|
1160
968
|
| undefined,
|
|
1161
969
|
callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
|
|
1162
970
|
): void;
|
|
1163
|
-
function stat(
|
|
971
|
+
export function stat(
|
|
1164
972
|
path: PathLike,
|
|
1165
973
|
options: StatOptions & {
|
|
1166
974
|
bigint: true;
|
|
1167
|
-
throwIfNoEntry?: true | undefined;
|
|
1168
975
|
},
|
|
1169
976
|
callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
|
|
1170
977
|
): void;
|
|
1171
|
-
function stat(
|
|
1172
|
-
path: PathLike,
|
|
1173
|
-
options: StatOptions & {
|
|
1174
|
-
bigint?: false | undefined;
|
|
1175
|
-
throwIfNoEntry: false;
|
|
1176
|
-
},
|
|
1177
|
-
callback: (err: NodeJS.ErrnoException | null, stats: Stats | undefined) => void,
|
|
1178
|
-
): void;
|
|
1179
|
-
function stat(
|
|
1180
|
-
path: PathLike,
|
|
1181
|
-
options: StatOptions & {
|
|
1182
|
-
bigint: true;
|
|
1183
|
-
throwIfNoEntry: false;
|
|
1184
|
-
},
|
|
1185
|
-
callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats | undefined) => void,
|
|
1186
|
-
): void;
|
|
1187
|
-
function stat(
|
|
1188
|
-
path: PathLike,
|
|
1189
|
-
options: StatOptions & {
|
|
1190
|
-
throwIfNoEntry?: true | undefined;
|
|
1191
|
-
},
|
|
1192
|
-
callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
|
|
1193
|
-
): void;
|
|
1194
|
-
function stat(
|
|
978
|
+
export function stat(
|
|
1195
979
|
path: PathLike,
|
|
1196
980
|
options: StatOptions | undefined,
|
|
1197
|
-
callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats
|
|
981
|
+
callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
|
|
1198
982
|
): void;
|
|
1199
|
-
namespace stat {
|
|
1200
|
-
// TODO: aliased promisify signatures
|
|
983
|
+
export namespace stat {
|
|
1201
984
|
/**
|
|
1202
985
|
* Asynchronous stat(2) - Get file status.
|
|
1203
986
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1204
987
|
*/
|
|
1205
|
-
function __promisify__(path: PathLike): Promise<Stats>;
|
|
1206
988
|
function __promisify__(
|
|
1207
989
|
path: PathLike,
|
|
1208
990
|
options?: StatOptions & {
|
|
1209
991
|
bigint?: false | undefined;
|
|
1210
|
-
throwIfNoEntry?: true | undefined;
|
|
1211
992
|
},
|
|
1212
993
|
): Promise<Stats>;
|
|
1213
994
|
function __promisify__(
|
|
1214
995
|
path: PathLike,
|
|
1215
996
|
options: StatOptions & {
|
|
1216
997
|
bigint: true;
|
|
1217
|
-
throwIfNoEntry?: true | undefined;
|
|
1218
998
|
},
|
|
1219
999
|
): Promise<BigIntStats>;
|
|
1220
|
-
function __promisify__(
|
|
1221
|
-
path: PathLike,
|
|
1222
|
-
options: StatOptions & {
|
|
1223
|
-
bigint?: false | undefined;
|
|
1224
|
-
throwIfNoEntry: false;
|
|
1225
|
-
},
|
|
1226
|
-
): Promise<Stats | undefined>;
|
|
1227
|
-
function __promisify__(
|
|
1228
|
-
path: PathLike,
|
|
1229
|
-
options: StatOptions & {
|
|
1230
|
-
bigint: true;
|
|
1231
|
-
throwIfNoEntry: false;
|
|
1232
|
-
},
|
|
1233
|
-
): Promise<BigIntStats | undefined>;
|
|
1234
|
-
function __promisify__(
|
|
1235
|
-
path: PathLike,
|
|
1236
|
-
options: StatOptions & {
|
|
1237
|
-
throwIfNoEntry?: true | undefined;
|
|
1238
|
-
},
|
|
1239
|
-
): Promise<Stats | BigIntStats>;
|
|
1240
|
-
function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats | undefined>;
|
|
1000
|
+
function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
|
|
1241
1001
|
}
|
|
1242
|
-
|
|
1243
|
-
interface StatSyncFn extends Function {
|
|
1002
|
+
export interface StatSyncFn extends Function {
|
|
1244
1003
|
(path: PathLike, options?: undefined): Stats;
|
|
1245
1004
|
(
|
|
1246
1005
|
path: PathLike,
|
|
@@ -1281,50 +1040,15 @@ declare module "node:fs" {
|
|
|
1281
1040
|
* Synchronous stat(2) - Get file status.
|
|
1282
1041
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1283
1042
|
*/
|
|
1284
|
-
|
|
1285
|
-
function statSync(
|
|
1286
|
-
path: PathLike,
|
|
1287
|
-
options?: StatOptions & {
|
|
1288
|
-
bigint?: false | undefined;
|
|
1289
|
-
throwIfNoEntry?: true | undefined;
|
|
1290
|
-
},
|
|
1291
|
-
): Stats;
|
|
1292
|
-
function statSync(
|
|
1293
|
-
path: PathLike,
|
|
1294
|
-
options: StatOptions & {
|
|
1295
|
-
bigint: true;
|
|
1296
|
-
throwIfNoEntry?: true | undefined;
|
|
1297
|
-
},
|
|
1298
|
-
): BigIntStats;
|
|
1299
|
-
function statSync(
|
|
1300
|
-
path: PathLike,
|
|
1301
|
-
options: StatOptions & {
|
|
1302
|
-
bigint?: false | undefined;
|
|
1303
|
-
throwIfNoEntry: false;
|
|
1304
|
-
},
|
|
1305
|
-
): Stats | undefined;
|
|
1306
|
-
function statSync(
|
|
1307
|
-
path: PathLike,
|
|
1308
|
-
options: StatOptions & {
|
|
1309
|
-
bigint: true;
|
|
1310
|
-
throwIfNoEntry: false;
|
|
1311
|
-
},
|
|
1312
|
-
): BigIntStats | undefined;
|
|
1313
|
-
function statSync(
|
|
1314
|
-
path: PathLike,
|
|
1315
|
-
options: StatOptions & {
|
|
1316
|
-
throwIfNoEntry?: true | undefined;
|
|
1317
|
-
},
|
|
1318
|
-
): Stats | BigIntStats;
|
|
1319
|
-
function statSync(path: PathLike, options?: StatOptions): Stats | BigIntStats | undefined;
|
|
1043
|
+
export const statSync: StatSyncFn;
|
|
1320
1044
|
/**
|
|
1321
1045
|
* Invokes the callback with the `fs.Stats` for the file descriptor.
|
|
1322
1046
|
*
|
|
1323
1047
|
* See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
|
|
1324
1048
|
* @since v0.1.95
|
|
1325
1049
|
*/
|
|
1326
|
-
function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
1327
|
-
function fstat(
|
|
1050
|
+
export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
1051
|
+
export function fstat(
|
|
1328
1052
|
fd: number,
|
|
1329
1053
|
options:
|
|
1330
1054
|
| (StatOptions & {
|
|
@@ -1333,19 +1057,19 @@ declare module "node:fs" {
|
|
|
1333
1057
|
| undefined,
|
|
1334
1058
|
callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
|
|
1335
1059
|
): void;
|
|
1336
|
-
function fstat(
|
|
1060
|
+
export function fstat(
|
|
1337
1061
|
fd: number,
|
|
1338
1062
|
options: StatOptions & {
|
|
1339
1063
|
bigint: true;
|
|
1340
1064
|
},
|
|
1341
1065
|
callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
|
|
1342
1066
|
): void;
|
|
1343
|
-
function fstat(
|
|
1067
|
+
export function fstat(
|
|
1344
1068
|
fd: number,
|
|
1345
1069
|
options: StatOptions | undefined,
|
|
1346
1070
|
callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
|
|
1347
1071
|
): void;
|
|
1348
|
-
namespace fstat {
|
|
1072
|
+
export namespace fstat {
|
|
1349
1073
|
/**
|
|
1350
1074
|
* Asynchronous fstat(2) - Get file status.
|
|
1351
1075
|
* @param fd A file descriptor.
|
|
@@ -1370,19 +1094,19 @@ declare module "node:fs" {
|
|
|
1370
1094
|
* See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
|
|
1371
1095
|
* @since v0.1.95
|
|
1372
1096
|
*/
|
|
1373
|
-
function fstatSync(
|
|
1097
|
+
export function fstatSync(
|
|
1374
1098
|
fd: number,
|
|
1375
1099
|
options?: StatOptions & {
|
|
1376
1100
|
bigint?: false | undefined;
|
|
1377
1101
|
},
|
|
1378
1102
|
): Stats;
|
|
1379
|
-
function fstatSync(
|
|
1103
|
+
export function fstatSync(
|
|
1380
1104
|
fd: number,
|
|
1381
1105
|
options: StatOptions & {
|
|
1382
1106
|
bigint: true;
|
|
1383
1107
|
},
|
|
1384
1108
|
): BigIntStats;
|
|
1385
|
-
function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
|
|
1109
|
+
export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
|
|
1386
1110
|
/**
|
|
1387
1111
|
* Retrieves the `fs.Stats` for the symbolic link referred to by the path.
|
|
1388
1112
|
* The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic
|
|
@@ -1391,8 +1115,8 @@ declare module "node:fs" {
|
|
|
1391
1115
|
* See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details.
|
|
1392
1116
|
* @since v0.1.30
|
|
1393
1117
|
*/
|
|
1394
|
-
function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
1395
|
-
function lstat(
|
|
1118
|
+
export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
|
1119
|
+
export function lstat(
|
|
1396
1120
|
path: PathLike,
|
|
1397
1121
|
options:
|
|
1398
1122
|
| (StatOptions & {
|
|
@@ -1401,19 +1125,19 @@ declare module "node:fs" {
|
|
|
1401
1125
|
| undefined,
|
|
1402
1126
|
callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void,
|
|
1403
1127
|
): void;
|
|
1404
|
-
function lstat(
|
|
1128
|
+
export function lstat(
|
|
1405
1129
|
path: PathLike,
|
|
1406
1130
|
options: StatOptions & {
|
|
1407
1131
|
bigint: true;
|
|
1408
1132
|
},
|
|
1409
1133
|
callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void,
|
|
1410
1134
|
): void;
|
|
1411
|
-
function lstat(
|
|
1135
|
+
export function lstat(
|
|
1412
1136
|
path: PathLike,
|
|
1413
1137
|
options: StatOptions | undefined,
|
|
1414
1138
|
callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void,
|
|
1415
1139
|
): void;
|
|
1416
|
-
namespace lstat {
|
|
1140
|
+
export namespace lstat {
|
|
1417
1141
|
/**
|
|
1418
1142
|
* Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
|
1419
1143
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1440,8 +1164,8 @@ declare module "node:fs" {
|
|
|
1440
1164
|
* @since v19.6.0, v18.15.0
|
|
1441
1165
|
* @param path A path to an existing file or directory on the file system to be queried.
|
|
1442
1166
|
*/
|
|
1443
|
-
function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void;
|
|
1444
|
-
function statfs(
|
|
1167
|
+
export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void;
|
|
1168
|
+
export function statfs(
|
|
1445
1169
|
path: PathLike,
|
|
1446
1170
|
options:
|
|
1447
1171
|
| (StatFsOptions & {
|
|
@@ -1450,19 +1174,19 @@ declare module "node:fs" {
|
|
|
1450
1174
|
| undefined,
|
|
1451
1175
|
callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void,
|
|
1452
1176
|
): void;
|
|
1453
|
-
function statfs(
|
|
1177
|
+
export function statfs(
|
|
1454
1178
|
path: PathLike,
|
|
1455
1179
|
options: StatFsOptions & {
|
|
1456
1180
|
bigint: true;
|
|
1457
1181
|
},
|
|
1458
1182
|
callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void,
|
|
1459
1183
|
): void;
|
|
1460
|
-
function statfs(
|
|
1184
|
+
export function statfs(
|
|
1461
1185
|
path: PathLike,
|
|
1462
1186
|
options: StatFsOptions | undefined,
|
|
1463
1187
|
callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void,
|
|
1464
1188
|
): void;
|
|
1465
|
-
namespace statfs {
|
|
1189
|
+
export namespace statfs {
|
|
1466
1190
|
/**
|
|
1467
1191
|
* Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an <fs.StatFs> object.
|
|
1468
1192
|
* @param path A path to an existing file or directory on the file system to be queried.
|
|
@@ -1489,67 +1213,32 @@ declare module "node:fs" {
|
|
|
1489
1213
|
* @since v19.6.0, v18.15.0
|
|
1490
1214
|
* @param path A path to an existing file or directory on the file system to be queried.
|
|
1491
1215
|
*/
|
|
1492
|
-
function statfsSync(
|
|
1216
|
+
export function statfsSync(
|
|
1493
1217
|
path: PathLike,
|
|
1494
1218
|
options?: StatFsOptions & {
|
|
1495
1219
|
bigint?: false | undefined;
|
|
1496
1220
|
},
|
|
1497
1221
|
): StatsFs;
|
|
1498
|
-
function statfsSync(
|
|
1222
|
+
export function statfsSync(
|
|
1499
1223
|
path: PathLike,
|
|
1500
1224
|
options: StatFsOptions & {
|
|
1501
1225
|
bigint: true;
|
|
1502
1226
|
},
|
|
1503
1227
|
): BigIntStatsFs;
|
|
1504
|
-
function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs;
|
|
1228
|
+
export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs;
|
|
1505
1229
|
/**
|
|
1506
1230
|
* Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
|
1507
1231
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1508
1232
|
*/
|
|
1509
|
-
|
|
1510
|
-
function lstatSync(
|
|
1511
|
-
path: PathLike,
|
|
1512
|
-
options?: StatOptions & {
|
|
1513
|
-
bigint?: false | undefined;
|
|
1514
|
-
throwIfNoEntry?: true | undefined;
|
|
1515
|
-
},
|
|
1516
|
-
): Stats;
|
|
1517
|
-
function lstatSync(
|
|
1518
|
-
path: PathLike,
|
|
1519
|
-
options: StatOptions & {
|
|
1520
|
-
bigint: true;
|
|
1521
|
-
throwIfNoEntry?: true | undefined;
|
|
1522
|
-
},
|
|
1523
|
-
): BigIntStats;
|
|
1524
|
-
function lstatSync(
|
|
1525
|
-
path: PathLike,
|
|
1526
|
-
options: StatOptions & {
|
|
1527
|
-
bigint?: false | undefined;
|
|
1528
|
-
throwIfNoEntry: false;
|
|
1529
|
-
},
|
|
1530
|
-
): Stats | undefined;
|
|
1531
|
-
function lstatSync(
|
|
1532
|
-
path: PathLike,
|
|
1533
|
-
options: StatOptions & {
|
|
1534
|
-
bigint: true;
|
|
1535
|
-
throwIfNoEntry: false;
|
|
1536
|
-
},
|
|
1537
|
-
): BigIntStats | undefined;
|
|
1538
|
-
function lstatSync(
|
|
1539
|
-
path: PathLike,
|
|
1540
|
-
options: StatOptions & {
|
|
1541
|
-
throwIfNoEntry?: true | undefined;
|
|
1542
|
-
},
|
|
1543
|
-
): Stats | BigIntStats;
|
|
1544
|
-
function lstatSync(path: PathLike, options?: StatOptions): Stats | BigIntStats | undefined;
|
|
1233
|
+
export const lstatSync: StatSyncFn;
|
|
1545
1234
|
/**
|
|
1546
1235
|
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than
|
|
1547
1236
|
* a possible
|
|
1548
1237
|
* exception are given to the completion callback.
|
|
1549
1238
|
* @since v0.1.31
|
|
1550
1239
|
*/
|
|
1551
|
-
function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
|
|
1552
|
-
namespace link {
|
|
1240
|
+
export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
|
|
1241
|
+
export namespace link {
|
|
1553
1242
|
/**
|
|
1554
1243
|
* Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
|
|
1555
1244
|
* @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1561,7 +1250,7 @@ declare module "node:fs" {
|
|
|
1561
1250
|
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`.
|
|
1562
1251
|
* @since v0.1.31
|
|
1563
1252
|
*/
|
|
1564
|
-
function linkSync(existingPath: PathLike, newPath: PathLike): void;
|
|
1253
|
+
export function linkSync(existingPath: PathLike, newPath: PathLike): void;
|
|
1565
1254
|
/**
|
|
1566
1255
|
* Creates the link called `path` pointing to `target`. No arguments other than a
|
|
1567
1256
|
* possible exception are given to the completion callback.
|
|
@@ -1595,7 +1284,7 @@ declare module "node:fs" {
|
|
|
1595
1284
|
* @since v0.1.31
|
|
1596
1285
|
* @param [type='null']
|
|
1597
1286
|
*/
|
|
1598
|
-
function symlink(
|
|
1287
|
+
export function symlink(
|
|
1599
1288
|
target: PathLike,
|
|
1600
1289
|
path: PathLike,
|
|
1601
1290
|
type: symlink.Type | undefined | null,
|
|
@@ -1606,8 +1295,8 @@ declare module "node:fs" {
|
|
|
1606
1295
|
* @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
|
|
1607
1296
|
* @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
|
|
1608
1297
|
*/
|
|
1609
|
-
function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
|
|
1610
|
-
namespace symlink {
|
|
1298
|
+
export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
|
|
1299
|
+
export namespace symlink {
|
|
1611
1300
|
/**
|
|
1612
1301
|
* Asynchronous symlink(2) - Create a new symbolic link to an existing file.
|
|
1613
1302
|
* @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1626,7 +1315,7 @@ declare module "node:fs" {
|
|
|
1626
1315
|
* @since v0.1.31
|
|
1627
1316
|
* @param [type='null']
|
|
1628
1317
|
*/
|
|
1629
|
-
function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void;
|
|
1318
|
+
export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void;
|
|
1630
1319
|
/**
|
|
1631
1320
|
* Reads the contents of the symbolic link referred to by `path`. The callback gets
|
|
1632
1321
|
* two arguments `(err, linkString)`.
|
|
@@ -1639,7 +1328,7 @@ declare module "node:fs" {
|
|
|
1639
1328
|
* the link path returned will be passed as a `Buffer` object.
|
|
1640
1329
|
* @since v0.1.31
|
|
1641
1330
|
*/
|
|
1642
|
-
function readlink(
|
|
1331
|
+
export function readlink(
|
|
1643
1332
|
path: PathLike,
|
|
1644
1333
|
options: EncodingOption,
|
|
1645
1334
|
callback: (err: NodeJS.ErrnoException | null, linkString: string) => void,
|
|
@@ -1649,7 +1338,7 @@ declare module "node:fs" {
|
|
|
1649
1338
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1650
1339
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1651
1340
|
*/
|
|
1652
|
-
function readlink(
|
|
1341
|
+
export function readlink(
|
|
1653
1342
|
path: PathLike,
|
|
1654
1343
|
options: BufferEncodingOption,
|
|
1655
1344
|
callback: (err: NodeJS.ErrnoException | null, linkString: NonSharedBuffer) => void,
|
|
@@ -1659,7 +1348,7 @@ declare module "node:fs" {
|
|
|
1659
1348
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1660
1349
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1661
1350
|
*/
|
|
1662
|
-
function readlink(
|
|
1351
|
+
export function readlink(
|
|
1663
1352
|
path: PathLike,
|
|
1664
1353
|
options: EncodingOption,
|
|
1665
1354
|
callback: (err: NodeJS.ErrnoException | null, linkString: string | NonSharedBuffer) => void,
|
|
@@ -1668,11 +1357,11 @@ declare module "node:fs" {
|
|
|
1668
1357
|
* Asynchronous readlink(2) - read value of a symbolic link.
|
|
1669
1358
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1670
1359
|
*/
|
|
1671
|
-
function readlink(
|
|
1360
|
+
export function readlink(
|
|
1672
1361
|
path: PathLike,
|
|
1673
1362
|
callback: (err: NodeJS.ErrnoException | null, linkString: string) => void,
|
|
1674
1363
|
): void;
|
|
1675
|
-
namespace readlink {
|
|
1364
|
+
export namespace readlink {
|
|
1676
1365
|
/**
|
|
1677
1366
|
* Asynchronous readlink(2) - read value of a symbolic link.
|
|
1678
1367
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1703,19 +1392,19 @@ declare module "node:fs" {
|
|
|
1703
1392
|
* the link path returned will be passed as a `Buffer` object.
|
|
1704
1393
|
* @since v0.1.31
|
|
1705
1394
|
*/
|
|
1706
|
-
function readlinkSync(path: PathLike, options?: EncodingOption): string;
|
|
1395
|
+
export function readlinkSync(path: PathLike, options?: EncodingOption): string;
|
|
1707
1396
|
/**
|
|
1708
1397
|
* Synchronous readlink(2) - read value of a symbolic link.
|
|
1709
1398
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1710
1399
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1711
1400
|
*/
|
|
1712
|
-
function readlinkSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer;
|
|
1401
|
+
export function readlinkSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer;
|
|
1713
1402
|
/**
|
|
1714
1403
|
* Synchronous readlink(2) - read value of a symbolic link.
|
|
1715
1404
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1716
1405
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1717
1406
|
*/
|
|
1718
|
-
function readlinkSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer;
|
|
1407
|
+
export function readlinkSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer;
|
|
1719
1408
|
/**
|
|
1720
1409
|
* Asynchronously computes the canonical pathname by resolving `.`, `..`, and
|
|
1721
1410
|
* symbolic links.
|
|
@@ -1742,7 +1431,7 @@ declare module "node:fs" {
|
|
|
1742
1431
|
* dependent name for that object.
|
|
1743
1432
|
* @since v0.1.31
|
|
1744
1433
|
*/
|
|
1745
|
-
function realpath(
|
|
1434
|
+
export function realpath(
|
|
1746
1435
|
path: PathLike,
|
|
1747
1436
|
options: EncodingOption,
|
|
1748
1437
|
callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
|
|
@@ -1752,7 +1441,7 @@ declare module "node:fs" {
|
|
|
1752
1441
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1753
1442
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1754
1443
|
*/
|
|
1755
|
-
function realpath(
|
|
1444
|
+
export function realpath(
|
|
1756
1445
|
path: PathLike,
|
|
1757
1446
|
options: BufferEncodingOption,
|
|
1758
1447
|
callback: (err: NodeJS.ErrnoException | null, resolvedPath: NonSharedBuffer) => void,
|
|
@@ -1762,7 +1451,7 @@ declare module "node:fs" {
|
|
|
1762
1451
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1763
1452
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1764
1453
|
*/
|
|
1765
|
-
function realpath(
|
|
1454
|
+
export function realpath(
|
|
1766
1455
|
path: PathLike,
|
|
1767
1456
|
options: EncodingOption,
|
|
1768
1457
|
callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | NonSharedBuffer) => void,
|
|
@@ -1771,11 +1460,11 @@ declare module "node:fs" {
|
|
|
1771
1460
|
* Asynchronous realpath(3) - return the canonicalized absolute pathname.
|
|
1772
1461
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1773
1462
|
*/
|
|
1774
|
-
function realpath(
|
|
1463
|
+
export function realpath(
|
|
1775
1464
|
path: PathLike,
|
|
1776
1465
|
callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void,
|
|
1777
1466
|
): void;
|
|
1778
|
-
namespace realpath {
|
|
1467
|
+
export namespace realpath {
|
|
1779
1468
|
/**
|
|
1780
1469
|
* Asynchronous realpath(3) - return the canonicalized absolute pathname.
|
|
1781
1470
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1838,20 +1527,20 @@ declare module "node:fs" {
|
|
|
1838
1527
|
* this API: {@link realpath}.
|
|
1839
1528
|
* @since v0.1.31
|
|
1840
1529
|
*/
|
|
1841
|
-
function realpathSync(path: PathLike, options?: EncodingOption): string;
|
|
1530
|
+
export function realpathSync(path: PathLike, options?: EncodingOption): string;
|
|
1842
1531
|
/**
|
|
1843
1532
|
* Synchronous realpath(3) - return the canonicalized absolute pathname.
|
|
1844
1533
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1845
1534
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1846
1535
|
*/
|
|
1847
|
-
function realpathSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer;
|
|
1536
|
+
export function realpathSync(path: PathLike, options: BufferEncodingOption): NonSharedBuffer;
|
|
1848
1537
|
/**
|
|
1849
1538
|
* Synchronous realpath(3) - return the canonicalized absolute pathname.
|
|
1850
1539
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1851
1540
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
1852
1541
|
*/
|
|
1853
|
-
function realpathSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer;
|
|
1854
|
-
namespace realpathSync {
|
|
1542
|
+
export function realpathSync(path: PathLike, options?: EncodingOption): string | NonSharedBuffer;
|
|
1543
|
+
export namespace realpathSync {
|
|
1855
1544
|
function native(path: PathLike, options?: EncodingOption): string;
|
|
1856
1545
|
function native(path: PathLike, options: BufferEncodingOption): NonSharedBuffer;
|
|
1857
1546
|
function native(path: PathLike, options?: EncodingOption): string | NonSharedBuffer;
|
|
@@ -1875,8 +1564,8 @@ declare module "node:fs" {
|
|
|
1875
1564
|
* See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details.
|
|
1876
1565
|
* @since v0.0.2
|
|
1877
1566
|
*/
|
|
1878
|
-
function unlink(path: PathLike, callback: NoParamCallback): void;
|
|
1879
|
-
namespace unlink {
|
|
1567
|
+
export function unlink(path: PathLike, callback: NoParamCallback): void;
|
|
1568
|
+
export namespace unlink {
|
|
1880
1569
|
/**
|
|
1881
1570
|
* Asynchronous unlink(2) - delete a name and possibly the file it refers to.
|
|
1882
1571
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -1887,10 +1576,34 @@ declare module "node:fs" {
|
|
|
1887
1576
|
* Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`.
|
|
1888
1577
|
* @since v0.1.21
|
|
1889
1578
|
*/
|
|
1890
|
-
function unlinkSync(path: PathLike): void;
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1579
|
+
export function unlinkSync(path: PathLike): void;
|
|
1580
|
+
export interface RmDirOptions {
|
|
1581
|
+
/**
|
|
1582
|
+
* If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
|
|
1583
|
+
* `EPERM` error is encountered, Node.js will retry the operation with a linear
|
|
1584
|
+
* backoff wait of `retryDelay` ms longer on each try. This option represents the
|
|
1585
|
+
* number of retries. This option is ignored if the `recursive` option is not
|
|
1586
|
+
* `true`.
|
|
1587
|
+
* @default 0
|
|
1588
|
+
*/
|
|
1589
|
+
maxRetries?: number | undefined;
|
|
1590
|
+
/**
|
|
1591
|
+
* @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning
|
|
1592
|
+
* `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file.
|
|
1593
|
+
* Use `fs.rm(path, { recursive: true, force: true })` instead.
|
|
1594
|
+
*
|
|
1595
|
+
* If `true`, perform a recursive directory removal. In
|
|
1596
|
+
* recursive mode, operations are retried on failure.
|
|
1597
|
+
* @default false
|
|
1598
|
+
*/
|
|
1599
|
+
recursive?: boolean | undefined;
|
|
1600
|
+
/**
|
|
1601
|
+
* The amount of time in milliseconds to wait between retries.
|
|
1602
|
+
* This option is ignored if the `recursive` option is not `true`.
|
|
1603
|
+
* @default 100
|
|
1604
|
+
*/
|
|
1605
|
+
retryDelay?: number | undefined;
|
|
1606
|
+
}
|
|
1894
1607
|
/**
|
|
1895
1608
|
* Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given
|
|
1896
1609
|
* to the completion callback.
|
|
@@ -1901,13 +1614,14 @@ declare module "node:fs" {
|
|
|
1901
1614
|
* To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`.
|
|
1902
1615
|
* @since v0.0.2
|
|
1903
1616
|
*/
|
|
1904
|
-
function rmdir(path: PathLike, callback: NoParamCallback): void;
|
|
1905
|
-
|
|
1617
|
+
export function rmdir(path: PathLike, callback: NoParamCallback): void;
|
|
1618
|
+
export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
|
|
1619
|
+
export namespace rmdir {
|
|
1906
1620
|
/**
|
|
1907
1621
|
* Asynchronous rmdir(2) - delete a directory.
|
|
1908
1622
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
1909
1623
|
*/
|
|
1910
|
-
function __promisify__(path: PathLike): Promise<void>;
|
|
1624
|
+
function __promisify__(path: PathLike, options?: RmDirOptions): Promise<void>;
|
|
1911
1625
|
}
|
|
1912
1626
|
/**
|
|
1913
1627
|
* Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`.
|
|
@@ -1918,8 +1632,8 @@ declare module "node:fs" {
|
|
|
1918
1632
|
* To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`.
|
|
1919
1633
|
* @since v0.1.21
|
|
1920
1634
|
*/
|
|
1921
|
-
function rmdirSync(path: PathLike): void;
|
|
1922
|
-
interface RmOptions {
|
|
1635
|
+
export function rmdirSync(path: PathLike, options?: RmDirOptions): void;
|
|
1636
|
+
export interface RmOptions {
|
|
1923
1637
|
/**
|
|
1924
1638
|
* When `true`, exceptions will be ignored if `path` does not exist.
|
|
1925
1639
|
* @default false
|
|
@@ -1952,9 +1666,9 @@ declare module "node:fs" {
|
|
|
1952
1666
|
* completion callback.
|
|
1953
1667
|
* @since v14.14.0
|
|
1954
1668
|
*/
|
|
1955
|
-
function rm(path: PathLike, callback: NoParamCallback): void;
|
|
1956
|
-
function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
|
|
1957
|
-
namespace rm {
|
|
1669
|
+
export function rm(path: PathLike, callback: NoParamCallback): void;
|
|
1670
|
+
export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
|
|
1671
|
+
export namespace rm {
|
|
1958
1672
|
/**
|
|
1959
1673
|
* Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
|
|
1960
1674
|
*/
|
|
@@ -1964,8 +1678,8 @@ declare module "node:fs" {
|
|
|
1964
1678
|
* Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). Returns `undefined`.
|
|
1965
1679
|
* @since v14.14.0
|
|
1966
1680
|
*/
|
|
1967
|
-
function rmSync(path: PathLike, options?: RmOptions): void;
|
|
1968
|
-
interface MakeDirectoryOptions {
|
|
1681
|
+
export function rmSync(path: PathLike, options?: RmOptions): void;
|
|
1682
|
+
export interface MakeDirectoryOptions {
|
|
1969
1683
|
/**
|
|
1970
1684
|
* Indicates whether parent folders should be created.
|
|
1971
1685
|
* If a folder was created, the path to the first created folder will be returned.
|
|
@@ -2014,7 +1728,7 @@ declare module "node:fs" {
|
|
|
2014
1728
|
* See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
|
|
2015
1729
|
* @since v0.1.8
|
|
2016
1730
|
*/
|
|
2017
|
-
function mkdir(
|
|
1731
|
+
export function mkdir(
|
|
2018
1732
|
path: PathLike,
|
|
2019
1733
|
options: MakeDirectoryOptions & {
|
|
2020
1734
|
recursive: true;
|
|
@@ -2027,7 +1741,7 @@ declare module "node:fs" {
|
|
|
2027
1741
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
2028
1742
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
2029
1743
|
*/
|
|
2030
|
-
function mkdir(
|
|
1744
|
+
export function mkdir(
|
|
2031
1745
|
path: PathLike,
|
|
2032
1746
|
options:
|
|
2033
1747
|
| Mode
|
|
@@ -2044,7 +1758,7 @@ declare module "node:fs" {
|
|
|
2044
1758
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
2045
1759
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
2046
1760
|
*/
|
|
2047
|
-
function mkdir(
|
|
1761
|
+
export function mkdir(
|
|
2048
1762
|
path: PathLike,
|
|
2049
1763
|
options: Mode | MakeDirectoryOptions | null | undefined,
|
|
2050
1764
|
callback: (err: NodeJS.ErrnoException | null, path?: string) => void,
|
|
@@ -2053,8 +1767,8 @@ declare module "node:fs" {
|
|
|
2053
1767
|
* Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
|
|
2054
1768
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2055
1769
|
*/
|
|
2056
|
-
function mkdir(path: PathLike, callback: NoParamCallback): void;
|
|
2057
|
-
namespace mkdir {
|
|
1770
|
+
export function mkdir(path: PathLike, callback: NoParamCallback): void;
|
|
1771
|
+
export namespace mkdir {
|
|
2058
1772
|
/**
|
|
2059
1773
|
* Asynchronous mkdir(2) - create a directory.
|
|
2060
1774
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -2100,7 +1814,7 @@ declare module "node:fs" {
|
|
|
2100
1814
|
* See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
|
|
2101
1815
|
* @since v0.1.21
|
|
2102
1816
|
*/
|
|
2103
|
-
function mkdirSync(
|
|
1817
|
+
export function mkdirSync(
|
|
2104
1818
|
path: PathLike,
|
|
2105
1819
|
options: MakeDirectoryOptions & {
|
|
2106
1820
|
recursive: true;
|
|
@@ -2112,7 +1826,7 @@ declare module "node:fs" {
|
|
|
2112
1826
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
2113
1827
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
2114
1828
|
*/
|
|
2115
|
-
function mkdirSync(
|
|
1829
|
+
export function mkdirSync(
|
|
2116
1830
|
path: PathLike,
|
|
2117
1831
|
options?:
|
|
2118
1832
|
| Mode
|
|
@@ -2127,7 +1841,7 @@ declare module "node:fs" {
|
|
|
2127
1841
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
2128
1842
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
2129
1843
|
*/
|
|
2130
|
-
function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined;
|
|
1844
|
+
export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined;
|
|
2131
1845
|
/**
|
|
2132
1846
|
* Creates a unique temporary directory.
|
|
2133
1847
|
*
|
|
@@ -2187,7 +1901,7 @@ declare module "node:fs" {
|
|
|
2187
1901
|
* ```
|
|
2188
1902
|
* @since v5.10.0
|
|
2189
1903
|
*/
|
|
2190
|
-
function mkdtemp(
|
|
1904
|
+
export function mkdtemp(
|
|
2191
1905
|
prefix: string,
|
|
2192
1906
|
options: EncodingOption,
|
|
2193
1907
|
callback: (err: NodeJS.ErrnoException | null, folder: string) => void,
|
|
@@ -2197,7 +1911,7 @@ declare module "node:fs" {
|
|
|
2197
1911
|
* Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
|
|
2198
1912
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2199
1913
|
*/
|
|
2200
|
-
function mkdtemp(
|
|
1914
|
+
export function mkdtemp(
|
|
2201
1915
|
prefix: string,
|
|
2202
1916
|
options: BufferEncodingOption,
|
|
2203
1917
|
callback: (err: NodeJS.ErrnoException | null, folder: NonSharedBuffer) => void,
|
|
@@ -2207,7 +1921,7 @@ declare module "node:fs" {
|
|
|
2207
1921
|
* Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
|
|
2208
1922
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2209
1923
|
*/
|
|
2210
|
-
function mkdtemp(
|
|
1924
|
+
export function mkdtemp(
|
|
2211
1925
|
prefix: string,
|
|
2212
1926
|
options: EncodingOption,
|
|
2213
1927
|
callback: (err: NodeJS.ErrnoException | null, folder: string | NonSharedBuffer) => void,
|
|
@@ -2216,11 +1930,11 @@ declare module "node:fs" {
|
|
|
2216
1930
|
* Asynchronously creates a unique temporary directory.
|
|
2217
1931
|
* Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
|
|
2218
1932
|
*/
|
|
2219
|
-
function mkdtemp(
|
|
1933
|
+
export function mkdtemp(
|
|
2220
1934
|
prefix: string,
|
|
2221
1935
|
callback: (err: NodeJS.ErrnoException | null, folder: string) => void,
|
|
2222
1936
|
): void;
|
|
2223
|
-
namespace mkdtemp {
|
|
1937
|
+
export namespace mkdtemp {
|
|
2224
1938
|
/**
|
|
2225
1939
|
* Asynchronously creates a unique temporary directory.
|
|
2226
1940
|
* Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
|
|
@@ -2250,52 +1964,19 @@ declare module "node:fs" {
|
|
|
2250
1964
|
* object with an `encoding` property specifying the character encoding to use.
|
|
2251
1965
|
* @since v5.10.0
|
|
2252
1966
|
*/
|
|
2253
|
-
function mkdtempSync(prefix: string, options?: EncodingOption): string;
|
|
1967
|
+
export function mkdtempSync(prefix: string, options?: EncodingOption): string;
|
|
2254
1968
|
/**
|
|
2255
1969
|
* Synchronously creates a unique temporary directory.
|
|
2256
1970
|
* Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
|
|
2257
1971
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2258
1972
|
*/
|
|
2259
|
-
function mkdtempSync(prefix: string, options: BufferEncodingOption): NonSharedBuffer;
|
|
1973
|
+
export function mkdtempSync(prefix: string, options: BufferEncodingOption): NonSharedBuffer;
|
|
2260
1974
|
/**
|
|
2261
1975
|
* Synchronously creates a unique temporary directory.
|
|
2262
1976
|
* Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
|
|
2263
1977
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2264
1978
|
*/
|
|
2265
|
-
function mkdtempSync(prefix: string, options?: EncodingOption): string | NonSharedBuffer;
|
|
2266
|
-
interface DisposableTempDir extends Disposable {
|
|
2267
|
-
/**
|
|
2268
|
-
* The path of the created directory.
|
|
2269
|
-
*/
|
|
2270
|
-
path: string;
|
|
2271
|
-
/**
|
|
2272
|
-
* A function which removes the created directory.
|
|
2273
|
-
*/
|
|
2274
|
-
remove(): void;
|
|
2275
|
-
/**
|
|
2276
|
-
* The same as `remove`.
|
|
2277
|
-
*/
|
|
2278
|
-
[Symbol.dispose](): void;
|
|
2279
|
-
}
|
|
2280
|
-
/**
|
|
2281
|
-
* Returns a disposable object whose `path` property holds the created directory
|
|
2282
|
-
* path. When the object is disposed, the directory and its contents will be
|
|
2283
|
-
* removed if it still exists. If the directory cannot be deleted, disposal will
|
|
2284
|
-
* throw an error. The object has a `remove()` method which will perform the same
|
|
2285
|
-
* task.
|
|
2286
|
-
*
|
|
2287
|
-
* <!-- TODO: link MDN docs for disposables once https://github.com/mdn/content/pull/38027 lands -->
|
|
2288
|
-
*
|
|
2289
|
-
* For detailed information, see the documentation of `fs.mkdtemp()`.
|
|
2290
|
-
*
|
|
2291
|
-
* There is no callback-based version of this API because it is designed for use
|
|
2292
|
-
* with the `using` syntax.
|
|
2293
|
-
*
|
|
2294
|
-
* The optional `options` argument can be a string specifying an encoding, or an
|
|
2295
|
-
* object with an `encoding` property specifying the character encoding to use.
|
|
2296
|
-
* @since v24.4.0
|
|
2297
|
-
*/
|
|
2298
|
-
function mkdtempDisposableSync(prefix: string, options?: EncodingOption): DisposableTempDir;
|
|
1979
|
+
export function mkdtempSync(prefix: string, options?: EncodingOption): string | NonSharedBuffer;
|
|
2299
1980
|
/**
|
|
2300
1981
|
* Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`.
|
|
2301
1982
|
*
|
|
@@ -2309,7 +1990,7 @@ declare module "node:fs" {
|
|
|
2309
1990
|
* If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects.
|
|
2310
1991
|
* @since v0.1.8
|
|
2311
1992
|
*/
|
|
2312
|
-
function readdir(
|
|
1993
|
+
export function readdir(
|
|
2313
1994
|
path: PathLike,
|
|
2314
1995
|
options:
|
|
2315
1996
|
| {
|
|
@@ -2327,7 +2008,7 @@ declare module "node:fs" {
|
|
|
2327
2008
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2328
2009
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2329
2010
|
*/
|
|
2330
|
-
function readdir(
|
|
2011
|
+
export function readdir(
|
|
2331
2012
|
path: PathLike,
|
|
2332
2013
|
options:
|
|
2333
2014
|
| {
|
|
@@ -2343,7 +2024,7 @@ declare module "node:fs" {
|
|
|
2343
2024
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2344
2025
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2345
2026
|
*/
|
|
2346
|
-
function readdir(
|
|
2027
|
+
export function readdir(
|
|
2347
2028
|
path: PathLike,
|
|
2348
2029
|
options:
|
|
2349
2030
|
| (ObjectEncodingOptions & {
|
|
@@ -2359,7 +2040,7 @@ declare module "node:fs" {
|
|
|
2359
2040
|
* Asynchronous readdir(3) - read a directory.
|
|
2360
2041
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2361
2042
|
*/
|
|
2362
|
-
function readdir(
|
|
2043
|
+
export function readdir(
|
|
2363
2044
|
path: PathLike,
|
|
2364
2045
|
callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
|
|
2365
2046
|
): void;
|
|
@@ -2368,7 +2049,7 @@ declare module "node:fs" {
|
|
|
2368
2049
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2369
2050
|
* @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
|
|
2370
2051
|
*/
|
|
2371
|
-
function readdir(
|
|
2052
|
+
export function readdir(
|
|
2372
2053
|
path: PathLike,
|
|
2373
2054
|
options: ObjectEncodingOptions & {
|
|
2374
2055
|
withFileTypes: true;
|
|
@@ -2381,7 +2062,7 @@ declare module "node:fs" {
|
|
|
2381
2062
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2382
2063
|
* @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
|
|
2383
2064
|
*/
|
|
2384
|
-
function readdir(
|
|
2065
|
+
export function readdir(
|
|
2385
2066
|
path: PathLike,
|
|
2386
2067
|
options: {
|
|
2387
2068
|
encoding: "buffer";
|
|
@@ -2390,7 +2071,7 @@ declare module "node:fs" {
|
|
|
2390
2071
|
},
|
|
2391
2072
|
callback: (err: NodeJS.ErrnoException | null, files: Dirent<NonSharedBuffer>[]) => void,
|
|
2392
2073
|
): void;
|
|
2393
|
-
namespace readdir {
|
|
2074
|
+
export namespace readdir {
|
|
2394
2075
|
/**
|
|
2395
2076
|
* Asynchronous readdir(3) - read a directory.
|
|
2396
2077
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -2476,7 +2157,7 @@ declare module "node:fs" {
|
|
|
2476
2157
|
* If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects.
|
|
2477
2158
|
* @since v0.1.21
|
|
2478
2159
|
*/
|
|
2479
|
-
function readdirSync(
|
|
2160
|
+
export function readdirSync(
|
|
2480
2161
|
path: PathLike,
|
|
2481
2162
|
options?:
|
|
2482
2163
|
| {
|
|
@@ -2492,7 +2173,7 @@ declare module "node:fs" {
|
|
|
2492
2173
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2493
2174
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2494
2175
|
*/
|
|
2495
|
-
function readdirSync(
|
|
2176
|
+
export function readdirSync(
|
|
2496
2177
|
path: PathLike,
|
|
2497
2178
|
options:
|
|
2498
2179
|
| {
|
|
@@ -2507,7 +2188,7 @@ declare module "node:fs" {
|
|
|
2507
2188
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2508
2189
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2509
2190
|
*/
|
|
2510
|
-
function readdirSync(
|
|
2191
|
+
export function readdirSync(
|
|
2511
2192
|
path: PathLike,
|
|
2512
2193
|
options?:
|
|
2513
2194
|
| (ObjectEncodingOptions & {
|
|
@@ -2522,7 +2203,7 @@ declare module "node:fs" {
|
|
|
2522
2203
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2523
2204
|
* @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
|
|
2524
2205
|
*/
|
|
2525
|
-
function readdirSync(
|
|
2206
|
+
export function readdirSync(
|
|
2526
2207
|
path: PathLike,
|
|
2527
2208
|
options: ObjectEncodingOptions & {
|
|
2528
2209
|
withFileTypes: true;
|
|
@@ -2534,7 +2215,7 @@ declare module "node:fs" {
|
|
|
2534
2215
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2535
2216
|
* @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
|
|
2536
2217
|
*/
|
|
2537
|
-
function readdirSync(
|
|
2218
|
+
export function readdirSync(
|
|
2538
2219
|
path: PathLike,
|
|
2539
2220
|
options: {
|
|
2540
2221
|
encoding: "buffer";
|
|
@@ -2552,8 +2233,8 @@ declare module "node:fs" {
|
|
|
2552
2233
|
* See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
|
|
2553
2234
|
* @since v0.0.2
|
|
2554
2235
|
*/
|
|
2555
|
-
function close(fd: number, callback?: NoParamCallback): void;
|
|
2556
|
-
namespace close {
|
|
2236
|
+
export function close(fd: number, callback?: NoParamCallback): void;
|
|
2237
|
+
export namespace close {
|
|
2557
2238
|
/**
|
|
2558
2239
|
* Asynchronous close(2) - close a file descriptor.
|
|
2559
2240
|
* @param fd A file descriptor.
|
|
@@ -2569,7 +2250,7 @@ declare module "node:fs" {
|
|
|
2569
2250
|
* See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
|
|
2570
2251
|
* @since v0.1.21
|
|
2571
2252
|
*/
|
|
2572
|
-
function closeSync(fd: number): void;
|
|
2253
|
+
export function closeSync(fd: number): void;
|
|
2573
2254
|
/**
|
|
2574
2255
|
* Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details.
|
|
2575
2256
|
*
|
|
@@ -2587,7 +2268,7 @@ declare module "node:fs" {
|
|
|
2587
2268
|
* @param [flags='r'] See `support of file system `flags``.
|
|
2588
2269
|
* @param [mode=0o666]
|
|
2589
2270
|
*/
|
|
2590
|
-
function open(
|
|
2271
|
+
export function open(
|
|
2591
2272
|
path: PathLike,
|
|
2592
2273
|
flags: OpenMode | undefined,
|
|
2593
2274
|
mode: Mode | undefined | null,
|
|
@@ -2598,7 +2279,7 @@ declare module "node:fs" {
|
|
|
2598
2279
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2599
2280
|
* @param [flags='r'] See `support of file system `flags``.
|
|
2600
2281
|
*/
|
|
2601
|
-
function open(
|
|
2282
|
+
export function open(
|
|
2602
2283
|
path: PathLike,
|
|
2603
2284
|
flags: OpenMode | undefined,
|
|
2604
2285
|
callback: (err: NodeJS.ErrnoException | null, fd: number) => void,
|
|
@@ -2607,8 +2288,8 @@ declare module "node:fs" {
|
|
|
2607
2288
|
* Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
|
|
2608
2289
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2609
2290
|
*/
|
|
2610
|
-
function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
|
|
2611
|
-
namespace open {
|
|
2291
|
+
export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
|
|
2292
|
+
export namespace open {
|
|
2612
2293
|
/**
|
|
2613
2294
|
* Asynchronous open(2) - open and possibly create a file.
|
|
2614
2295
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -2625,7 +2306,7 @@ declare module "node:fs" {
|
|
|
2625
2306
|
* @param [flags='r']
|
|
2626
2307
|
* @param [mode=0o666]
|
|
2627
2308
|
*/
|
|
2628
|
-
function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number;
|
|
2309
|
+
export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number;
|
|
2629
2310
|
/**
|
|
2630
2311
|
* Change the file system timestamps of the object referenced by `path`.
|
|
2631
2312
|
*
|
|
@@ -2635,8 +2316,8 @@ declare module "node:fs" {
|
|
|
2635
2316
|
* * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown.
|
|
2636
2317
|
* @since v0.4.2
|
|
2637
2318
|
*/
|
|
2638
|
-
function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
|
|
2639
|
-
namespace utimes {
|
|
2319
|
+
export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
|
|
2320
|
+
export namespace utimes {
|
|
2640
2321
|
/**
|
|
2641
2322
|
* Asynchronously change file timestamps of the file referenced by the supplied path.
|
|
2642
2323
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -2652,14 +2333,14 @@ declare module "node:fs" {
|
|
|
2652
2333
|
* this API: {@link utimes}.
|
|
2653
2334
|
* @since v0.4.2
|
|
2654
2335
|
*/
|
|
2655
|
-
function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
|
|
2336
|
+
export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void;
|
|
2656
2337
|
/**
|
|
2657
2338
|
* Change the file system timestamps of the object referenced by the supplied file
|
|
2658
2339
|
* descriptor. See {@link utimes}.
|
|
2659
2340
|
* @since v0.4.2
|
|
2660
2341
|
*/
|
|
2661
|
-
function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
|
|
2662
|
-
namespace futimes {
|
|
2342
|
+
export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
|
|
2343
|
+
export namespace futimes {
|
|
2663
2344
|
/**
|
|
2664
2345
|
* Asynchronously change file timestamps of the file referenced by the supplied file descriptor.
|
|
2665
2346
|
* @param fd A file descriptor.
|
|
@@ -2672,7 +2353,7 @@ declare module "node:fs" {
|
|
|
2672
2353
|
* Synchronous version of {@link futimes}. Returns `undefined`.
|
|
2673
2354
|
* @since v0.4.2
|
|
2674
2355
|
*/
|
|
2675
|
-
function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void;
|
|
2356
|
+
export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void;
|
|
2676
2357
|
/**
|
|
2677
2358
|
* Request that all data for the open file descriptor is flushed to the storage
|
|
2678
2359
|
* device. The specific implementation is operating system and device specific.
|
|
@@ -2680,8 +2361,8 @@ declare module "node:fs" {
|
|
|
2680
2361
|
* than a possible exception are given to the completion callback.
|
|
2681
2362
|
* @since v0.1.96
|
|
2682
2363
|
*/
|
|
2683
|
-
function fsync(fd: number, callback: NoParamCallback): void;
|
|
2684
|
-
namespace fsync {
|
|
2364
|
+
export function fsync(fd: number, callback: NoParamCallback): void;
|
|
2365
|
+
export namespace fsync {
|
|
2685
2366
|
/**
|
|
2686
2367
|
* Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
|
|
2687
2368
|
* @param fd A file descriptor.
|
|
@@ -2694,8 +2375,8 @@ declare module "node:fs" {
|
|
|
2694
2375
|
* Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`.
|
|
2695
2376
|
* @since v0.1.96
|
|
2696
2377
|
*/
|
|
2697
|
-
function fsyncSync(fd: number): void;
|
|
2698
|
-
interface WriteOptions {
|
|
2378
|
+
export function fsyncSync(fd: number): void;
|
|
2379
|
+
export interface WriteOptions {
|
|
2699
2380
|
/**
|
|
2700
2381
|
* @default 0
|
|
2701
2382
|
*/
|
|
@@ -2736,7 +2417,7 @@ declare module "node:fs" {
|
|
|
2736
2417
|
* @param [length=buffer.byteLength - offset]
|
|
2737
2418
|
* @param [position='null']
|
|
2738
2419
|
*/
|
|
2739
|
-
function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2420
|
+
export function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2740
2421
|
fd: number,
|
|
2741
2422
|
buffer: TBuffer,
|
|
2742
2423
|
offset: number | undefined | null,
|
|
@@ -2750,7 +2431,7 @@ declare module "node:fs" {
|
|
|
2750
2431
|
* @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
|
|
2751
2432
|
* @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
|
|
2752
2433
|
*/
|
|
2753
|
-
function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2434
|
+
export function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2754
2435
|
fd: number,
|
|
2755
2436
|
buffer: TBuffer,
|
|
2756
2437
|
offset: number | undefined | null,
|
|
@@ -2762,7 +2443,7 @@ declare module "node:fs" {
|
|
|
2762
2443
|
* @param fd A file descriptor.
|
|
2763
2444
|
* @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
|
|
2764
2445
|
*/
|
|
2765
|
-
function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2446
|
+
export function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2766
2447
|
fd: number,
|
|
2767
2448
|
buffer: TBuffer,
|
|
2768
2449
|
offset: number | undefined | null,
|
|
@@ -2772,7 +2453,7 @@ declare module "node:fs" {
|
|
|
2772
2453
|
* Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
|
|
2773
2454
|
* @param fd A file descriptor.
|
|
2774
2455
|
*/
|
|
2775
|
-
function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2456
|
+
export function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2776
2457
|
fd: number,
|
|
2777
2458
|
buffer: TBuffer,
|
|
2778
2459
|
callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
|
|
@@ -2785,7 +2466,7 @@ declare module "node:fs" {
|
|
|
2785
2466
|
* * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
|
|
2786
2467
|
* * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
2787
2468
|
*/
|
|
2788
|
-
function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2469
|
+
export function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2789
2470
|
fd: number,
|
|
2790
2471
|
buffer: TBuffer,
|
|
2791
2472
|
options: WriteOptions,
|
|
@@ -2798,7 +2479,7 @@ declare module "node:fs" {
|
|
|
2798
2479
|
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
2799
2480
|
* @param encoding The expected string encoding.
|
|
2800
2481
|
*/
|
|
2801
|
-
function write(
|
|
2482
|
+
export function write(
|
|
2802
2483
|
fd: number,
|
|
2803
2484
|
string: string,
|
|
2804
2485
|
position: number | undefined | null,
|
|
@@ -2811,7 +2492,7 @@ declare module "node:fs" {
|
|
|
2811
2492
|
* @param string A string to write.
|
|
2812
2493
|
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
2813
2494
|
*/
|
|
2814
|
-
function write(
|
|
2495
|
+
export function write(
|
|
2815
2496
|
fd: number,
|
|
2816
2497
|
string: string,
|
|
2817
2498
|
position: number | undefined | null,
|
|
@@ -2822,12 +2503,12 @@ declare module "node:fs" {
|
|
|
2822
2503
|
* @param fd A file descriptor.
|
|
2823
2504
|
* @param string A string to write.
|
|
2824
2505
|
*/
|
|
2825
|
-
function write(
|
|
2506
|
+
export function write(
|
|
2826
2507
|
fd: number,
|
|
2827
2508
|
string: string,
|
|
2828
2509
|
callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
|
|
2829
2510
|
): void;
|
|
2830
|
-
namespace write {
|
|
2511
|
+
export namespace write {
|
|
2831
2512
|
/**
|
|
2832
2513
|
* Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
|
|
2833
2514
|
* @param fd A file descriptor.
|
|
@@ -2887,7 +2568,7 @@ declare module "node:fs" {
|
|
|
2887
2568
|
* @param [position='null']
|
|
2888
2569
|
* @return The number of bytes written.
|
|
2889
2570
|
*/
|
|
2890
|
-
function writeSync(
|
|
2571
|
+
export function writeSync(
|
|
2891
2572
|
fd: number,
|
|
2892
2573
|
buffer: NodeJS.ArrayBufferView,
|
|
2893
2574
|
offset?: number | null,
|
|
@@ -2901,14 +2582,14 @@ declare module "node:fs" {
|
|
|
2901
2582
|
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
2902
2583
|
* @param encoding The expected string encoding.
|
|
2903
2584
|
*/
|
|
2904
|
-
function writeSync(
|
|
2585
|
+
export function writeSync(
|
|
2905
2586
|
fd: number,
|
|
2906
2587
|
string: string,
|
|
2907
2588
|
position?: number | null,
|
|
2908
2589
|
encoding?: BufferEncoding | null,
|
|
2909
2590
|
): number;
|
|
2910
|
-
type ReadPosition = number | bigint;
|
|
2911
|
-
interface ReadOptions {
|
|
2591
|
+
export type ReadPosition = number | bigint;
|
|
2592
|
+
export interface ReadOptions {
|
|
2912
2593
|
/**
|
|
2913
2594
|
* @default 0
|
|
2914
2595
|
*/
|
|
@@ -2922,9 +2603,15 @@ declare module "node:fs" {
|
|
|
2922
2603
|
*/
|
|
2923
2604
|
position?: ReadPosition | null | undefined;
|
|
2924
2605
|
}
|
|
2925
|
-
interface ReadOptionsWithBuffer<T extends NodeJS.ArrayBufferView> extends ReadOptions {
|
|
2606
|
+
export interface ReadOptionsWithBuffer<T extends NodeJS.ArrayBufferView> extends ReadOptions {
|
|
2926
2607
|
buffer?: T | undefined;
|
|
2927
2608
|
}
|
|
2609
|
+
/** @deprecated Use `ReadOptions` instead. */
|
|
2610
|
+
// TODO: remove in future major
|
|
2611
|
+
export interface ReadSyncOptions extends ReadOptions {}
|
|
2612
|
+
/** @deprecated Use `ReadOptionsWithBuffer` instead. */
|
|
2613
|
+
// TODO: remove in future major
|
|
2614
|
+
export interface ReadAsyncOptions<T extends NodeJS.ArrayBufferView> extends ReadOptionsWithBuffer<T> {}
|
|
2928
2615
|
/**
|
|
2929
2616
|
* Read data from the file specified by `fd`.
|
|
2930
2617
|
*
|
|
@@ -2942,7 +2629,7 @@ declare module "node:fs" {
|
|
|
2942
2629
|
* @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If
|
|
2943
2630
|
* `position` is an integer, the file position will be unchanged.
|
|
2944
2631
|
*/
|
|
2945
|
-
function read<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2632
|
+
export function read<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2946
2633
|
fd: number,
|
|
2947
2634
|
buffer: TBuffer,
|
|
2948
2635
|
offset: number,
|
|
@@ -2959,27 +2646,27 @@ declare module "node:fs" {
|
|
|
2959
2646
|
* `position` defaults to `null`
|
|
2960
2647
|
* @since v12.17.0, 13.11.0
|
|
2961
2648
|
*/
|
|
2962
|
-
function read<TBuffer extends NodeJS.ArrayBufferView = NonSharedBuffer>(
|
|
2649
|
+
export function read<TBuffer extends NodeJS.ArrayBufferView = NonSharedBuffer>(
|
|
2963
2650
|
fd: number,
|
|
2964
2651
|
options: ReadOptionsWithBuffer<TBuffer>,
|
|
2965
2652
|
callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
|
|
2966
2653
|
): void;
|
|
2967
|
-
function read<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2654
|
+
export function read<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2968
2655
|
fd: number,
|
|
2969
2656
|
buffer: TBuffer,
|
|
2970
2657
|
options: ReadOptions,
|
|
2971
2658
|
callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
|
|
2972
2659
|
): void;
|
|
2973
|
-
function read<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2660
|
+
export function read<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2974
2661
|
fd: number,
|
|
2975
2662
|
buffer: TBuffer,
|
|
2976
2663
|
callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
|
|
2977
2664
|
): void;
|
|
2978
|
-
function read(
|
|
2665
|
+
export function read(
|
|
2979
2666
|
fd: number,
|
|
2980
2667
|
callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NonSharedBuffer) => void,
|
|
2981
2668
|
): void;
|
|
2982
|
-
namespace read {
|
|
2669
|
+
export namespace read {
|
|
2983
2670
|
/**
|
|
2984
2671
|
* @param fd A file descriptor.
|
|
2985
2672
|
* @param buffer The buffer that the data will be written to.
|
|
@@ -3017,7 +2704,7 @@ declare module "node:fs" {
|
|
|
3017
2704
|
* @since v0.1.21
|
|
3018
2705
|
* @param [position='null']
|
|
3019
2706
|
*/
|
|
3020
|
-
function readSync(
|
|
2707
|
+
export function readSync(
|
|
3021
2708
|
fd: number,
|
|
3022
2709
|
buffer: NodeJS.ArrayBufferView,
|
|
3023
2710
|
offset: number,
|
|
@@ -3028,20 +2715,7 @@ declare module "node:fs" {
|
|
|
3028
2715
|
* Similar to the above `fs.readSync` function, this version takes an optional `options` object.
|
|
3029
2716
|
* If no `options` object is specified, it will default with the above values.
|
|
3030
2717
|
*/
|
|
3031
|
-
function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadOptions): number;
|
|
3032
|
-
interface ReadFileOptions extends Abortable {
|
|
3033
|
-
encoding?: BufferEncoding | null | undefined;
|
|
3034
|
-
flag?: OpenMode | undefined;
|
|
3035
|
-
}
|
|
3036
|
-
interface ReadFileOptionsWithStringEncoding extends ReadFileOptions {
|
|
3037
|
-
encoding: BufferEncoding;
|
|
3038
|
-
}
|
|
3039
|
-
interface ReadFileOptionsWithBufferEncoding extends ReadFileOptions {
|
|
3040
|
-
encoding?: null | undefined;
|
|
3041
|
-
}
|
|
3042
|
-
interface ReadFileOptionsWithBuffer<T extends NodeJS.ArrayBufferView> extends ReadFileOptionsWithBufferEncoding {
|
|
3043
|
-
buffer: T | ((size: number) => T);
|
|
3044
|
-
}
|
|
2718
|
+
export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadOptions): number;
|
|
3045
2719
|
/**
|
|
3046
2720
|
* Asynchronously reads the entire contents of a file.
|
|
3047
2721
|
*
|
|
@@ -3059,11 +2733,6 @@ declare module "node:fs" {
|
|
|
3059
2733
|
*
|
|
3060
2734
|
* If no encoding is specified, then the raw buffer is returned.
|
|
3061
2735
|
*
|
|
3062
|
-
* If `buffer` is provided and no encoding is specified, the returned `Buffer` is
|
|
3063
|
-
* a view over the supplied buffer containing only the bytes read. If the
|
|
3064
|
-
* supplied buffer is too small to contain the entire file, the callback is
|
|
3065
|
-
* called with an error.
|
|
3066
|
-
*
|
|
3067
2736
|
* If `options` is a string, then it specifies the encoding:
|
|
3068
2737
|
*
|
|
3069
2738
|
* ```js
|
|
@@ -3072,8 +2741,7 @@ declare module "node:fs" {
|
|
|
3072
2741
|
* readFile('/etc/passwd', 'utf8', callback);
|
|
3073
2742
|
* ```
|
|
3074
2743
|
*
|
|
3075
|
-
* When the path is a directory, the behavior of `fs.readFile()` and
|
|
3076
|
-
* `fs.readFileSync()` is platform-specific. On macOS, Linux, and Windows, an
|
|
2744
|
+
* When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an
|
|
3077
2745
|
* error will be returned. On FreeBSD, a representation of the directory's contents
|
|
3078
2746
|
* will be returned.
|
|
3079
2747
|
*
|
|
@@ -3111,61 +2779,65 @@ declare module "node:fs" {
|
|
|
3111
2779
|
*
|
|
3112
2780
|
* Aborting an ongoing request does not abort individual operating
|
|
3113
2781
|
* system requests but rather the internal buffering `fs.readFile` performs.
|
|
3114
|
-
*
|
|
3115
|
-
* An example using the `buffer` option with a pre-allocated buffer:
|
|
3116
|
-
*
|
|
3117
|
-
* ```js
|
|
3118
|
-
* import { Buffer } from 'node:buffer';
|
|
3119
|
-
* import { readFile } from 'node:fs';
|
|
3120
|
-
*
|
|
3121
|
-
* const buf = Buffer.alloc(16384);
|
|
3122
|
-
* readFile('/path/to/file', { buffer: buf }, (err, data) => {
|
|
3123
|
-
* if (err) throw err;
|
|
3124
|
-
* console.log(data); // A view over `buf` containing only the bytes read
|
|
3125
|
-
* });
|
|
3126
|
-
* ```
|
|
3127
|
-
*
|
|
3128
|
-
* An example using the `buffer` option with a function returning a buffer:
|
|
3129
|
-
*
|
|
3130
|
-
* ```js
|
|
3131
|
-
* import { Buffer } from 'node:buffer';
|
|
3132
|
-
* import { readFile } from 'node:fs';
|
|
3133
|
-
*
|
|
3134
|
-
* readFile('/path/to/file', {
|
|
3135
|
-
* buffer: (size) => Buffer.alloc(size),
|
|
3136
|
-
* }, (err, data) => {
|
|
3137
|
-
* if (err) throw err;
|
|
3138
|
-
* console.log(data);
|
|
3139
|
-
* });
|
|
3140
|
-
* ```
|
|
3141
2782
|
* @since v0.1.29
|
|
3142
2783
|
* @param path filename or file descriptor
|
|
3143
2784
|
*/
|
|
3144
|
-
function readFile
|
|
3145
|
-
path: PathOrFileDescriptor,
|
|
3146
|
-
options: ReadFileOptionsWithBuffer<T>,
|
|
3147
|
-
callback: (err: NodeJS.ErrnoException | null, data: BufferView<T>) => void,
|
|
3148
|
-
): void;
|
|
3149
|
-
function readFile(
|
|
2785
|
+
export function readFile(
|
|
3150
2786
|
path: PathOrFileDescriptor,
|
|
3151
|
-
options:
|
|
2787
|
+
options:
|
|
2788
|
+
| ({
|
|
2789
|
+
encoding?: null | undefined;
|
|
2790
|
+
flag?: string | undefined;
|
|
2791
|
+
} & Abortable)
|
|
2792
|
+
| undefined
|
|
2793
|
+
| null,
|
|
3152
2794
|
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
|
3153
2795
|
): void;
|
|
3154
|
-
|
|
2796
|
+
/**
|
|
2797
|
+
* Asynchronously reads the entire contents of a file.
|
|
2798
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2799
|
+
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
2800
|
+
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
2801
|
+
* If a flag is not provided, it defaults to `'r'`.
|
|
2802
|
+
*/
|
|
2803
|
+
export function readFile(
|
|
3155
2804
|
path: PathOrFileDescriptor,
|
|
3156
|
-
options:
|
|
2805
|
+
options:
|
|
2806
|
+
| ({
|
|
2807
|
+
encoding: BufferEncoding;
|
|
2808
|
+
flag?: string | undefined;
|
|
2809
|
+
} & Abortable)
|
|
2810
|
+
| BufferEncoding,
|
|
3157
2811
|
callback: (err: NodeJS.ErrnoException | null, data: string) => void,
|
|
3158
2812
|
): void;
|
|
3159
|
-
|
|
2813
|
+
/**
|
|
2814
|
+
* Asynchronously reads the entire contents of a file.
|
|
2815
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2816
|
+
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
2817
|
+
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
2818
|
+
* If a flag is not provided, it defaults to `'r'`.
|
|
2819
|
+
*/
|
|
2820
|
+
export function readFile(
|
|
3160
2821
|
path: PathOrFileDescriptor,
|
|
3161
|
-
options:
|
|
2822
|
+
options:
|
|
2823
|
+
| (ObjectEncodingOptions & {
|
|
2824
|
+
flag?: string | undefined;
|
|
2825
|
+
} & Abortable)
|
|
2826
|
+
| BufferEncoding
|
|
2827
|
+
| undefined
|
|
2828
|
+
| null,
|
|
3162
2829
|
callback: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,
|
|
3163
2830
|
): void;
|
|
3164
|
-
|
|
2831
|
+
/**
|
|
2832
|
+
* Asynchronously reads the entire contents of a file.
|
|
2833
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2834
|
+
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
2835
|
+
*/
|
|
2836
|
+
export function readFile(
|
|
3165
2837
|
path: PathOrFileDescriptor,
|
|
3166
2838
|
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
|
3167
2839
|
): void;
|
|
3168
|
-
namespace readFile {
|
|
2840
|
+
export namespace readFile {
|
|
3169
2841
|
/**
|
|
3170
2842
|
* Asynchronously reads the entire contents of a file.
|
|
3171
2843
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -3215,37 +2887,16 @@ declare module "node:fs" {
|
|
|
3215
2887
|
| null,
|
|
3216
2888
|
): Promise<string | NonSharedBuffer>;
|
|
3217
2889
|
}
|
|
3218
|
-
interface ReadFileSyncOptions {
|
|
3219
|
-
encoding?: BufferEncoding | null | undefined;
|
|
3220
|
-
flag?: OpenMode | undefined;
|
|
3221
|
-
}
|
|
3222
|
-
interface ReadFileSyncOptionsWithStringEncoding extends ReadFileSyncOptions {
|
|
3223
|
-
encoding: BufferEncoding;
|
|
3224
|
-
}
|
|
3225
|
-
interface ReadFileSyncOptionsWithBufferEncoding extends ReadFileSyncOptions {
|
|
3226
|
-
encoding?: null | undefined;
|
|
3227
|
-
}
|
|
3228
|
-
interface ReadFileSyncOptionsWithBuffer<T extends NodeJS.ArrayBufferView>
|
|
3229
|
-
extends ReadFileSyncOptionsWithBufferEncoding
|
|
3230
|
-
{
|
|
3231
|
-
buffer: T | ((size: number) => T);
|
|
3232
|
-
}
|
|
3233
2890
|
/**
|
|
3234
2891
|
* Returns the contents of the `path`.
|
|
3235
2892
|
*
|
|
3236
2893
|
* For detailed information, see the documentation of the asynchronous version of
|
|
3237
|
-
* this API:
|
|
2894
|
+
* this API: {@link readFile}.
|
|
3238
2895
|
*
|
|
3239
2896
|
* If the `encoding` option is specified then this function returns a
|
|
3240
2897
|
* string. Otherwise it returns a buffer.
|
|
3241
2898
|
*
|
|
3242
|
-
*
|
|
3243
|
-
* a view over the supplied buffer containing only the bytes read. If the
|
|
3244
|
-
* supplied buffer is too small to contain the entire file, an error will be
|
|
3245
|
-
* thrown.
|
|
3246
|
-
*
|
|
3247
|
-
* Similar to `fs.readFile()`, when the path is a directory, the behavior of
|
|
3248
|
-
* `fs.readFileSync()` is platform-specific.
|
|
2899
|
+
* Similar to {@link readFile}, when the path is a directory, the behavior of `fs.readFileSync()` is platform-specific.
|
|
3249
2900
|
*
|
|
3250
2901
|
* ```js
|
|
3251
2902
|
* import { readFileSync } from 'node:fs';
|
|
@@ -3260,20 +2911,46 @@ declare module "node:fs" {
|
|
|
3260
2911
|
* @since v0.1.8
|
|
3261
2912
|
* @param path filename or file descriptor
|
|
3262
2913
|
*/
|
|
3263
|
-
function readFileSync
|
|
3264
|
-
path: PathOrFileDescriptor,
|
|
3265
|
-
options: ReadFileSyncOptionsWithBuffer<T>,
|
|
3266
|
-
): BufferView<T>;
|
|
3267
|
-
function readFileSync(
|
|
2914
|
+
export function readFileSync(
|
|
3268
2915
|
path: PathOrFileDescriptor,
|
|
3269
|
-
options?:
|
|
2916
|
+
options?: {
|
|
2917
|
+
encoding?: null | undefined;
|
|
2918
|
+
flag?: string | undefined;
|
|
2919
|
+
} | null,
|
|
3270
2920
|
): NonSharedBuffer;
|
|
3271
|
-
|
|
2921
|
+
/**
|
|
2922
|
+
* Synchronously reads the entire contents of a file.
|
|
2923
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2924
|
+
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
2925
|
+
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
2926
|
+
* If a flag is not provided, it defaults to `'r'`.
|
|
2927
|
+
*/
|
|
2928
|
+
export function readFileSync(
|
|
3272
2929
|
path: PathOrFileDescriptor,
|
|
3273
|
-
options:
|
|
2930
|
+
options:
|
|
2931
|
+
| {
|
|
2932
|
+
encoding: BufferEncoding;
|
|
2933
|
+
flag?: string | undefined;
|
|
2934
|
+
}
|
|
2935
|
+
| BufferEncoding,
|
|
3274
2936
|
): string;
|
|
3275
|
-
|
|
3276
|
-
|
|
2937
|
+
/**
|
|
2938
|
+
* Synchronously reads the entire contents of a file.
|
|
2939
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2940
|
+
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
2941
|
+
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
2942
|
+
* If a flag is not provided, it defaults to `'r'`.
|
|
2943
|
+
*/
|
|
2944
|
+
export function readFileSync(
|
|
2945
|
+
path: PathOrFileDescriptor,
|
|
2946
|
+
options?:
|
|
2947
|
+
| (ObjectEncodingOptions & {
|
|
2948
|
+
flag?: string | undefined;
|
|
2949
|
+
})
|
|
2950
|
+
| BufferEncoding
|
|
2951
|
+
| null,
|
|
2952
|
+
): string | NonSharedBuffer;
|
|
2953
|
+
export type WriteFileOptions =
|
|
3277
2954
|
| (
|
|
3278
2955
|
& ObjectEncodingOptions
|
|
3279
2956
|
& Abortable
|
|
@@ -3346,7 +3023,7 @@ declare module "node:fs" {
|
|
|
3346
3023
|
* @since v0.1.29
|
|
3347
3024
|
* @param file filename or file descriptor
|
|
3348
3025
|
*/
|
|
3349
|
-
function writeFile(
|
|
3026
|
+
export function writeFile(
|
|
3350
3027
|
file: PathOrFileDescriptor,
|
|
3351
3028
|
data: string | NodeJS.ArrayBufferView,
|
|
3352
3029
|
options: WriteFileOptions,
|
|
@@ -3358,12 +3035,12 @@ declare module "node:fs" {
|
|
|
3358
3035
|
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3359
3036
|
* @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
|
|
3360
3037
|
*/
|
|
3361
|
-
function writeFile(
|
|
3038
|
+
export function writeFile(
|
|
3362
3039
|
path: PathOrFileDescriptor,
|
|
3363
3040
|
data: string | NodeJS.ArrayBufferView,
|
|
3364
3041
|
callback: NoParamCallback,
|
|
3365
3042
|
): void;
|
|
3366
|
-
namespace writeFile {
|
|
3043
|
+
export namespace writeFile {
|
|
3367
3044
|
/**
|
|
3368
3045
|
* Asynchronously writes data to a file, replacing the file if it already exists.
|
|
3369
3046
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -3392,7 +3069,7 @@ declare module "node:fs" {
|
|
|
3392
3069
|
* @since v0.1.29
|
|
3393
3070
|
* @param file filename or file descriptor
|
|
3394
3071
|
*/
|
|
3395
|
-
function writeFileSync(
|
|
3072
|
+
export function writeFileSync(
|
|
3396
3073
|
file: PathOrFileDescriptor,
|
|
3397
3074
|
data: string | NodeJS.ArrayBufferView,
|
|
3398
3075
|
options?: WriteFileOptions,
|
|
@@ -3450,7 +3127,7 @@ declare module "node:fs" {
|
|
|
3450
3127
|
* @since v0.6.7
|
|
3451
3128
|
* @param path filename or file descriptor
|
|
3452
3129
|
*/
|
|
3453
|
-
function appendFile(
|
|
3130
|
+
export function appendFile(
|
|
3454
3131
|
path: PathOrFileDescriptor,
|
|
3455
3132
|
data: string | Uint8Array,
|
|
3456
3133
|
options: WriteFileOptions,
|
|
@@ -3462,8 +3139,8 @@ declare module "node:fs" {
|
|
|
3462
3139
|
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3463
3140
|
* @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
|
|
3464
3141
|
*/
|
|
3465
|
-
function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void;
|
|
3466
|
-
namespace appendFile {
|
|
3142
|
+
export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void;
|
|
3143
|
+
export namespace appendFile {
|
|
3467
3144
|
/**
|
|
3468
3145
|
* Asynchronously append data to a file, creating the file if it does not exist.
|
|
3469
3146
|
* @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -3529,7 +3206,7 @@ declare module "node:fs" {
|
|
|
3529
3206
|
* @since v0.6.7
|
|
3530
3207
|
* @param path filename or file descriptor
|
|
3531
3208
|
*/
|
|
3532
|
-
function appendFileSync(
|
|
3209
|
+
export function appendFileSync(
|
|
3533
3210
|
path: PathOrFileDescriptor,
|
|
3534
3211
|
data: string | Uint8Array,
|
|
3535
3212
|
options?: WriteFileOptions,
|
|
@@ -3580,7 +3257,7 @@ declare module "node:fs" {
|
|
|
3580
3257
|
* * the file is renamed and then renamed a second time back to its original name
|
|
3581
3258
|
* @since v0.1.31
|
|
3582
3259
|
*/
|
|
3583
|
-
interface WatchFileOptions {
|
|
3260
|
+
export interface WatchFileOptions {
|
|
3584
3261
|
bigint?: boolean | undefined;
|
|
3585
3262
|
persistent?: boolean | undefined;
|
|
3586
3263
|
interval?: number | undefined;
|
|
@@ -3631,7 +3308,7 @@ declare module "node:fs" {
|
|
|
3631
3308
|
* * the file is renamed and then renamed a second time back to its original name
|
|
3632
3309
|
* @since v0.1.31
|
|
3633
3310
|
*/
|
|
3634
|
-
function watchFile(
|
|
3311
|
+
export function watchFile(
|
|
3635
3312
|
filename: PathLike,
|
|
3636
3313
|
options:
|
|
3637
3314
|
| (WatchFileOptions & {
|
|
@@ -3640,7 +3317,7 @@ declare module "node:fs" {
|
|
|
3640
3317
|
| undefined,
|
|
3641
3318
|
listener: StatsListener,
|
|
3642
3319
|
): StatWatcher;
|
|
3643
|
-
function watchFile(
|
|
3320
|
+
export function watchFile(
|
|
3644
3321
|
filename: PathLike,
|
|
3645
3322
|
options:
|
|
3646
3323
|
| (WatchFileOptions & {
|
|
@@ -3653,7 +3330,7 @@ declare module "node:fs" {
|
|
|
3653
3330
|
* Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
|
|
3654
3331
|
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
3655
3332
|
*/
|
|
3656
|
-
function watchFile(filename: PathLike, listener: StatsListener): StatWatcher;
|
|
3333
|
+
export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher;
|
|
3657
3334
|
/**
|
|
3658
3335
|
* Stop watching for changes on `filename`. If `listener` is specified, only that
|
|
3659
3336
|
* particular listener is removed. Otherwise, _all_ listeners are removed,
|
|
@@ -3666,25 +3343,23 @@ declare module "node:fs" {
|
|
|
3666
3343
|
* @since v0.1.31
|
|
3667
3344
|
* @param listener Optional, a listener previously attached using `fs.watchFile()`
|
|
3668
3345
|
*/
|
|
3669
|
-
function unwatchFile(filename: PathLike, listener?: StatsListener): void;
|
|
3670
|
-
function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
|
|
3671
|
-
|
|
3672
|
-
interface WatchOptions extends Abortable {
|
|
3346
|
+
export function unwatchFile(filename: PathLike, listener?: StatsListener): void;
|
|
3347
|
+
export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
|
|
3348
|
+
export interface WatchOptions extends Abortable {
|
|
3673
3349
|
encoding?: BufferEncoding | "buffer" | undefined;
|
|
3674
3350
|
persistent?: boolean | undefined;
|
|
3675
3351
|
recursive?: boolean | undefined;
|
|
3676
|
-
ignore?: WatchIgnorePredicate | readonly WatchIgnorePredicate[] | undefined;
|
|
3677
3352
|
}
|
|
3678
|
-
interface WatchOptionsWithBufferEncoding extends WatchOptions {
|
|
3353
|
+
export interface WatchOptionsWithBufferEncoding extends WatchOptions {
|
|
3679
3354
|
encoding: "buffer";
|
|
3680
3355
|
}
|
|
3681
|
-
interface WatchOptionsWithStringEncoding extends WatchOptions {
|
|
3356
|
+
export interface WatchOptionsWithStringEncoding extends WatchOptions {
|
|
3682
3357
|
encoding?: BufferEncoding | undefined;
|
|
3683
3358
|
}
|
|
3684
|
-
type WatchEventType = "rename" | "change";
|
|
3685
|
-
type WatchListener<T> = (event: WatchEventType, filename: T | null) => void;
|
|
3686
|
-
type StatsListener = (curr: Stats, prev: Stats) => void;
|
|
3687
|
-
type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void;
|
|
3359
|
+
export type WatchEventType = "rename" | "change";
|
|
3360
|
+
export type WatchListener<T> = (event: WatchEventType, filename: T | null) => void;
|
|
3361
|
+
export type StatsListener = (curr: Stats, prev: Stats) => void;
|
|
3362
|
+
export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void;
|
|
3688
3363
|
/**
|
|
3689
3364
|
* Watch for changes on `filename`, where `filename` is either a file or a
|
|
3690
3365
|
* directory.
|
|
@@ -3705,22 +3380,22 @@ declare module "node:fs" {
|
|
|
3705
3380
|
* @since v0.5.10
|
|
3706
3381
|
* @param listener
|
|
3707
3382
|
*/
|
|
3708
|
-
function watch(
|
|
3383
|
+
export function watch(
|
|
3709
3384
|
filename: PathLike,
|
|
3710
3385
|
options?: WatchOptionsWithStringEncoding | BufferEncoding | null,
|
|
3711
3386
|
listener?: WatchListener<string>,
|
|
3712
3387
|
): FSWatcher;
|
|
3713
|
-
function watch(
|
|
3388
|
+
export function watch(
|
|
3714
3389
|
filename: PathLike,
|
|
3715
3390
|
options: WatchOptionsWithBufferEncoding | "buffer",
|
|
3716
3391
|
listener: WatchListener<NonSharedBuffer>,
|
|
3717
3392
|
): FSWatcher;
|
|
3718
|
-
function watch(
|
|
3393
|
+
export function watch(
|
|
3719
3394
|
filename: PathLike,
|
|
3720
3395
|
options: WatchOptions | BufferEncoding | "buffer" | null,
|
|
3721
3396
|
listener: WatchListener<string | NonSharedBuffer>,
|
|
3722
3397
|
): FSWatcher;
|
|
3723
|
-
function watch(filename: PathLike, listener: WatchListener<string>): FSWatcher;
|
|
3398
|
+
export function watch(filename: PathLike, listener: WatchListener<string>): FSWatcher;
|
|
3724
3399
|
/**
|
|
3725
3400
|
* Test whether or not the given path exists by checking with the file system.
|
|
3726
3401
|
* Then call the `callback` argument with either true or false:
|
|
@@ -3850,9 +3525,9 @@ declare module "node:fs" {
|
|
|
3850
3525
|
* @since v0.0.2
|
|
3851
3526
|
* @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead.
|
|
3852
3527
|
*/
|
|
3853
|
-
function exists(path: PathLike, callback: (exists: boolean) => void): void;
|
|
3528
|
+
export function exists(path: PathLike, callback: (exists: boolean) => void): void;
|
|
3854
3529
|
/** @deprecated */
|
|
3855
|
-
namespace exists {
|
|
3530
|
+
export namespace exists {
|
|
3856
3531
|
/**
|
|
3857
3532
|
* @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
3858
3533
|
* URL support is _experimental_.
|
|
@@ -3876,8 +3551,8 @@ declare module "node:fs" {
|
|
|
3876
3551
|
* ```
|
|
3877
3552
|
* @since v0.1.21
|
|
3878
3553
|
*/
|
|
3879
|
-
function existsSync(path: PathLike): boolean;
|
|
3880
|
-
namespace constants {
|
|
3554
|
+
export function existsSync(path: PathLike): boolean;
|
|
3555
|
+
export namespace constants {
|
|
3881
3556
|
// File Access Constants
|
|
3882
3557
|
/** Constant for fs.access(). File is visible to the calling process. */
|
|
3883
3558
|
const F_OK: number;
|
|
@@ -4151,13 +3826,13 @@ declare module "node:fs" {
|
|
|
4151
3826
|
* @since v0.11.15
|
|
4152
3827
|
* @param [mode=fs.constants.F_OK]
|
|
4153
3828
|
*/
|
|
4154
|
-
function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
|
|
3829
|
+
export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
|
|
4155
3830
|
/**
|
|
4156
3831
|
* Asynchronously tests a user's permissions for the file specified by path.
|
|
4157
3832
|
* @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
4158
3833
|
*/
|
|
4159
|
-
function access(path: PathLike, callback: NoParamCallback): void;
|
|
4160
|
-
namespace access {
|
|
3834
|
+
export function access(path: PathLike, callback: NoParamCallback): void;
|
|
3835
|
+
export namespace access {
|
|
4161
3836
|
/**
|
|
4162
3837
|
* Asynchronously tests a user's permissions for the file specified by path.
|
|
4163
3838
|
* @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -4188,11 +3863,11 @@ declare module "node:fs" {
|
|
|
4188
3863
|
* @since v0.11.15
|
|
4189
3864
|
* @param [mode=fs.constants.F_OK]
|
|
4190
3865
|
*/
|
|
4191
|
-
function accessSync(path: PathLike, mode?: number): void;
|
|
3866
|
+
export function accessSync(path: PathLike, mode?: number): void;
|
|
4192
3867
|
interface StreamOptions {
|
|
4193
3868
|
flags?: string | undefined;
|
|
4194
3869
|
encoding?: BufferEncoding | undefined;
|
|
4195
|
-
fd?: number | FileHandle | undefined;
|
|
3870
|
+
fd?: number | promises.FileHandle | undefined;
|
|
4196
3871
|
mode?: number | undefined;
|
|
4197
3872
|
autoClose?: boolean | undefined;
|
|
4198
3873
|
emitClose?: boolean | undefined;
|
|
@@ -4280,7 +3955,7 @@ declare module "node:fs" {
|
|
|
4280
3955
|
* If `options` is a string, then it specifies the encoding.
|
|
4281
3956
|
* @since v0.1.31
|
|
4282
3957
|
*/
|
|
4283
|
-
function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream;
|
|
3958
|
+
export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream;
|
|
4284
3959
|
/**
|
|
4285
3960
|
* `options` may also include a `start` option to allow writing data at some
|
|
4286
3961
|
* position past the beginning of the file, allowed values are in the
|
|
@@ -4308,7 +3983,7 @@ declare module "node:fs" {
|
|
|
4308
3983
|
* If `options` is a string, then it specifies the encoding.
|
|
4309
3984
|
* @since v0.1.31
|
|
4310
3985
|
*/
|
|
4311
|
-
function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream;
|
|
3986
|
+
export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream;
|
|
4312
3987
|
/**
|
|
4313
3988
|
* Forces all currently queued I/O operations associated with the file to the
|
|
4314
3989
|
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other
|
|
@@ -4316,8 +3991,8 @@ declare module "node:fs" {
|
|
|
4316
3991
|
* exception are given to the completion callback.
|
|
4317
3992
|
* @since v0.1.96
|
|
4318
3993
|
*/
|
|
4319
|
-
function fdatasync(fd: number, callback: NoParamCallback): void;
|
|
4320
|
-
namespace fdatasync {
|
|
3994
|
+
export function fdatasync(fd: number, callback: NoParamCallback): void;
|
|
3995
|
+
export namespace fdatasync {
|
|
4321
3996
|
/**
|
|
4322
3997
|
* Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
|
|
4323
3998
|
* @param fd A file descriptor.
|
|
@@ -4329,7 +4004,7 @@ declare module "node:fs" {
|
|
|
4329
4004
|
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`.
|
|
4330
4005
|
* @since v0.1.96
|
|
4331
4006
|
*/
|
|
4332
|
-
function fdatasyncSync(fd: number): void;
|
|
4007
|
+
export function fdatasyncSync(fd: number): void;
|
|
4333
4008
|
/**
|
|
4334
4009
|
* Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
|
|
4335
4010
|
* already exists. No arguments other than a possible exception are given to the
|
|
@@ -4369,9 +4044,9 @@ declare module "node:fs" {
|
|
|
4369
4044
|
* @param dest destination filename of the copy operation
|
|
4370
4045
|
* @param [mode=0] modifiers for copy operation.
|
|
4371
4046
|
*/
|
|
4372
|
-
function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
|
|
4373
|
-
function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
|
|
4374
|
-
namespace copyFile {
|
|
4047
|
+
export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
|
|
4048
|
+
export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
|
|
4049
|
+
export namespace copyFile {
|
|
4375
4050
|
function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise<void>;
|
|
4376
4051
|
}
|
|
4377
4052
|
/**
|
|
@@ -4408,7 +4083,7 @@ declare module "node:fs" {
|
|
|
4408
4083
|
* @param dest destination filename of the copy operation
|
|
4409
4084
|
* @param [mode=0] modifiers for copy operation.
|
|
4410
4085
|
*/
|
|
4411
|
-
function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
|
|
4086
|
+
export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
|
|
4412
4087
|
/**
|
|
4413
4088
|
* Write an array of `ArrayBufferView`s to the file specified by `fd` using `writev()`.
|
|
4414
4089
|
*
|
|
@@ -4429,12 +4104,12 @@ declare module "node:fs" {
|
|
|
4429
4104
|
* @since v12.9.0
|
|
4430
4105
|
* @param [position='null']
|
|
4431
4106
|
*/
|
|
4432
|
-
function writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4107
|
+
export function writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4433
4108
|
fd: number,
|
|
4434
4109
|
buffers: TBuffers,
|
|
4435
4110
|
cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: TBuffers) => void,
|
|
4436
4111
|
): void;
|
|
4437
|
-
function writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4112
|
+
export function writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4438
4113
|
fd: number,
|
|
4439
4114
|
buffers: TBuffers,
|
|
4440
4115
|
position: number | null,
|
|
@@ -4442,11 +4117,11 @@ declare module "node:fs" {
|
|
|
4442
4117
|
): void;
|
|
4443
4118
|
// Providing a default type parameter doesn't provide true BC for userland consumers, but at least suppresses TS2314
|
|
4444
4119
|
// TODO: remove default in future major version
|
|
4445
|
-
interface WriteVResult<T extends readonly NodeJS.ArrayBufferView[] = NodeJS.ArrayBufferView[]> {
|
|
4120
|
+
export interface WriteVResult<T extends readonly NodeJS.ArrayBufferView[] = NodeJS.ArrayBufferView[]> {
|
|
4446
4121
|
bytesWritten: number;
|
|
4447
4122
|
buffers: T;
|
|
4448
4123
|
}
|
|
4449
|
-
namespace writev {
|
|
4124
|
+
export namespace writev {
|
|
4450
4125
|
function __promisify__<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4451
4126
|
fd: number,
|
|
4452
4127
|
buffers: TBuffers,
|
|
@@ -4460,7 +4135,7 @@ declare module "node:fs" {
|
|
|
4460
4135
|
* @param [position='null']
|
|
4461
4136
|
* @return The number of bytes written.
|
|
4462
4137
|
*/
|
|
4463
|
-
function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
|
|
4138
|
+
export function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
|
|
4464
4139
|
/**
|
|
4465
4140
|
* Read from a file specified by `fd` and write to an array of `ArrayBufferView`s
|
|
4466
4141
|
* using `readv()`.
|
|
@@ -4476,12 +4151,12 @@ declare module "node:fs" {
|
|
|
4476
4151
|
* @since v13.13.0, v12.17.0
|
|
4477
4152
|
* @param [position='null']
|
|
4478
4153
|
*/
|
|
4479
|
-
function readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4154
|
+
export function readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4480
4155
|
fd: number,
|
|
4481
4156
|
buffers: TBuffers,
|
|
4482
4157
|
cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: TBuffers) => void,
|
|
4483
4158
|
): void;
|
|
4484
|
-
function readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4159
|
+
export function readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4485
4160
|
fd: number,
|
|
4486
4161
|
buffers: TBuffers,
|
|
4487
4162
|
position: number | null,
|
|
@@ -4489,11 +4164,11 @@ declare module "node:fs" {
|
|
|
4489
4164
|
): void;
|
|
4490
4165
|
// Providing a default type parameter doesn't provide true BC for userland consumers, but at least suppresses TS2314
|
|
4491
4166
|
// TODO: remove default in future major version
|
|
4492
|
-
interface ReadVResult<T extends readonly NodeJS.ArrayBufferView[] = NodeJS.ArrayBufferView[]> {
|
|
4167
|
+
export interface ReadVResult<T extends readonly NodeJS.ArrayBufferView[] = NodeJS.ArrayBufferView[]> {
|
|
4493
4168
|
bytesRead: number;
|
|
4494
4169
|
buffers: T;
|
|
4495
4170
|
}
|
|
4496
|
-
namespace readv {
|
|
4171
|
+
export namespace readv {
|
|
4497
4172
|
function __promisify__<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
|
|
4498
4173
|
fd: number,
|
|
4499
4174
|
buffers: TBuffers,
|
|
@@ -4507,9 +4182,9 @@ declare module "node:fs" {
|
|
|
4507
4182
|
* @param [position='null']
|
|
4508
4183
|
* @return The number of bytes read.
|
|
4509
4184
|
*/
|
|
4510
|
-
function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
|
|
4185
|
+
export function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
|
|
4511
4186
|
|
|
4512
|
-
interface OpenAsBlobOptions {
|
|
4187
|
+
export interface OpenAsBlobOptions {
|
|
4513
4188
|
/**
|
|
4514
4189
|
* An optional mime type for the blob.
|
|
4515
4190
|
*
|
|
@@ -4535,9 +4210,9 @@ declare module "node:fs" {
|
|
|
4535
4210
|
* ```
|
|
4536
4211
|
* @since v19.8.0
|
|
4537
4212
|
*/
|
|
4538
|
-
function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise<Blob>;
|
|
4213
|
+
export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise<Blob>;
|
|
4539
4214
|
|
|
4540
|
-
interface OpenDirOptions {
|
|
4215
|
+
export interface OpenDirOptions {
|
|
4541
4216
|
/**
|
|
4542
4217
|
* @default 'utf8'
|
|
4543
4218
|
*/
|
|
@@ -4564,7 +4239,7 @@ declare module "node:fs" {
|
|
|
4564
4239
|
* directory and subsequent read operations.
|
|
4565
4240
|
* @since v12.12.0
|
|
4566
4241
|
*/
|
|
4567
|
-
function opendirSync(path: PathLike, options?: OpenDirOptions): Dir;
|
|
4242
|
+
export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir;
|
|
4568
4243
|
/**
|
|
4569
4244
|
* Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for
|
|
4570
4245
|
* more details.
|
|
@@ -4576,31 +4251,30 @@ declare module "node:fs" {
|
|
|
4576
4251
|
* directory and subsequent read operations.
|
|
4577
4252
|
* @since v12.12.0
|
|
4578
4253
|
*/
|
|
4579
|
-
function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
|
|
4580
|
-
function opendir(
|
|
4254
|
+
export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
|
|
4255
|
+
export function opendir(
|
|
4581
4256
|
path: PathLike,
|
|
4582
4257
|
options: OpenDirOptions,
|
|
4583
4258
|
cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void,
|
|
4584
4259
|
): void;
|
|
4585
|
-
namespace opendir {
|
|
4260
|
+
export namespace opendir {
|
|
4586
4261
|
function __promisify__(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
|
|
4587
4262
|
}
|
|
4588
|
-
interface BigIntStats extends StatsBase<bigint> {
|
|
4263
|
+
export interface BigIntStats extends StatsBase<bigint> {
|
|
4589
4264
|
atimeNs: bigint;
|
|
4590
4265
|
mtimeNs: bigint;
|
|
4591
4266
|
ctimeNs: bigint;
|
|
4592
4267
|
birthtimeNs: bigint;
|
|
4593
4268
|
}
|
|
4594
|
-
interface BigIntOptions {
|
|
4269
|
+
export interface BigIntOptions {
|
|
4595
4270
|
bigint: true;
|
|
4596
4271
|
}
|
|
4597
|
-
interface StatOptions {
|
|
4598
|
-
// TODO: add signal option once we sort its behavior out upstream
|
|
4272
|
+
export interface StatOptions {
|
|
4599
4273
|
bigint?: boolean | undefined;
|
|
4274
|
+
}
|
|
4275
|
+
export interface StatSyncOptions extends StatOptions {
|
|
4600
4276
|
throwIfNoEntry?: boolean | undefined;
|
|
4601
4277
|
}
|
|
4602
|
-
/** @deprecated This orphaned interface will be removed in a future version. Use `StatOptions` instead. */
|
|
4603
|
-
interface StatSyncOptions extends StatOptions {}
|
|
4604
4278
|
interface CopyOptionsBase {
|
|
4605
4279
|
/**
|
|
4606
4280
|
* Dereference symlinks
|
|
@@ -4641,14 +4315,14 @@ declare module "node:fs" {
|
|
|
4641
4315
|
*/
|
|
4642
4316
|
verbatimSymlinks?: boolean | undefined;
|
|
4643
4317
|
}
|
|
4644
|
-
interface CopyOptions extends CopyOptionsBase {
|
|
4318
|
+
export interface CopyOptions extends CopyOptionsBase {
|
|
4645
4319
|
/**
|
|
4646
4320
|
* Function to filter copied files/directories. Return
|
|
4647
4321
|
* `true` to copy the item, `false` to ignore it.
|
|
4648
4322
|
*/
|
|
4649
4323
|
filter?: ((source: string, destination: string) => boolean | Promise<boolean>) | undefined;
|
|
4650
4324
|
}
|
|
4651
|
-
interface CopySyncOptions extends CopyOptionsBase {
|
|
4325
|
+
export interface CopySyncOptions extends CopyOptionsBase {
|
|
4652
4326
|
/**
|
|
4653
4327
|
* Function to filter copied files/directories. Return
|
|
4654
4328
|
* `true` to copy the item, `false` to ignore it.
|
|
@@ -4666,12 +4340,12 @@ declare module "node:fs" {
|
|
|
4666
4340
|
* @param src source path to copy.
|
|
4667
4341
|
* @param dest destination path to copy to.
|
|
4668
4342
|
*/
|
|
4669
|
-
function cp(
|
|
4343
|
+
export function cp(
|
|
4670
4344
|
source: string | URL,
|
|
4671
4345
|
destination: string | URL,
|
|
4672
4346
|
callback: (err: NodeJS.ErrnoException | null) => void,
|
|
4673
4347
|
): void;
|
|
4674
|
-
function cp(
|
|
4348
|
+
export function cp(
|
|
4675
4349
|
source: string | URL,
|
|
4676
4350
|
destination: string | URL,
|
|
4677
4351
|
opts: CopyOptions,
|
|
@@ -4688,49 +4362,41 @@ declare module "node:fs" {
|
|
|
4688
4362
|
* @param src source path to copy.
|
|
4689
4363
|
* @param dest destination path to copy to.
|
|
4690
4364
|
*/
|
|
4691
|
-
function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
|
|
4692
|
-
|
|
4365
|
+
export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
|
|
4366
|
+
|
|
4367
|
+
interface _GlobOptions<T extends Dirent | string> {
|
|
4693
4368
|
/**
|
|
4694
4369
|
* Current working directory.
|
|
4695
4370
|
* @default process.cwd()
|
|
4696
4371
|
*/
|
|
4697
4372
|
cwd?: string | URL | undefined;
|
|
4698
|
-
/**
|
|
4699
|
-
* Function to filter out files/directories or a
|
|
4700
|
-
* list of glob patterns to be excluded. If a function is provided, return
|
|
4701
|
-
* `true` to exclude the item, `false` to include it.
|
|
4702
|
-
* If a string array is provided, each string should be a glob pattern that
|
|
4703
|
-
* specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are
|
|
4704
|
-
* not supported.
|
|
4705
|
-
* @default undefined
|
|
4706
|
-
*/
|
|
4707
|
-
exclude?: ((fileName: T) => boolean) | readonly string[] | undefined;
|
|
4708
|
-
/**
|
|
4709
|
-
* When `true`, symbolic links to directories are
|
|
4710
|
-
* followed while expanding `**` patterns.
|
|
4711
|
-
* @default false
|
|
4712
|
-
*/
|
|
4713
|
-
followSymlinks?: boolean | undefined;
|
|
4714
4373
|
/**
|
|
4715
4374
|
* `true` if the glob should return paths as `Dirent`s, `false` otherwise.
|
|
4716
4375
|
* @default false
|
|
4717
4376
|
* @since v22.2.0
|
|
4718
4377
|
*/
|
|
4719
4378
|
withFileTypes?: boolean | undefined;
|
|
4379
|
+
/**
|
|
4380
|
+
* Function to filter out files/directories or a
|
|
4381
|
+
* list of glob patterns to be excluded. If a function is provided, return
|
|
4382
|
+
* `true` to exclude the item, `false` to include it. If a string array is
|
|
4383
|
+
* provided, each string should be a glob pattern that specifies paths to exclude.
|
|
4384
|
+
* Note: Negation patterns (e.g., '!foo.js') are not supported.
|
|
4385
|
+
* @default undefined
|
|
4386
|
+
*/
|
|
4387
|
+
exclude?: ((fileName: T) => boolean) | readonly string[] | undefined;
|
|
4720
4388
|
}
|
|
4721
|
-
interface
|
|
4389
|
+
export interface GlobOptions extends _GlobOptions<Dirent | string> {}
|
|
4390
|
+
export interface GlobOptionsWithFileTypes extends _GlobOptions<Dirent> {
|
|
4722
4391
|
withFileTypes: true;
|
|
4723
4392
|
}
|
|
4724
|
-
interface GlobOptionsWithoutFileTypes extends
|
|
4393
|
+
export interface GlobOptionsWithoutFileTypes extends _GlobOptions<string> {
|
|
4725
4394
|
withFileTypes?: false | undefined;
|
|
4726
4395
|
}
|
|
4727
4396
|
|
|
4728
4397
|
/**
|
|
4729
4398
|
* Retrieves the files matching the specified pattern.
|
|
4730
4399
|
*
|
|
4731
|
-
* When `followSymlinks` is enabled, detected symbolic link cycles are not
|
|
4732
|
-
* traversed recursively.
|
|
4733
|
-
*
|
|
4734
4400
|
* ```js
|
|
4735
4401
|
* import { glob } from 'node:fs';
|
|
4736
4402
|
*
|
|
@@ -4741,11 +4407,11 @@ declare module "node:fs" {
|
|
|
4741
4407
|
* ```
|
|
4742
4408
|
* @since v22.0.0
|
|
4743
4409
|
*/
|
|
4744
|
-
function glob(
|
|
4410
|
+
export function glob(
|
|
4745
4411
|
pattern: string | readonly string[],
|
|
4746
4412
|
callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
|
|
4747
4413
|
): void;
|
|
4748
|
-
function glob(
|
|
4414
|
+
export function glob(
|
|
4749
4415
|
pattern: string | readonly string[],
|
|
4750
4416
|
options: GlobOptionsWithFileTypes,
|
|
4751
4417
|
callback: (
|
|
@@ -4753,7 +4419,7 @@ declare module "node:fs" {
|
|
|
4753
4419
|
matches: Dirent[],
|
|
4754
4420
|
) => void,
|
|
4755
4421
|
): void;
|
|
4756
|
-
function glob(
|
|
4422
|
+
export function glob(
|
|
4757
4423
|
pattern: string | readonly string[],
|
|
4758
4424
|
options: GlobOptionsWithoutFileTypes,
|
|
4759
4425
|
callback: (
|
|
@@ -4761,7 +4427,7 @@ declare module "node:fs" {
|
|
|
4761
4427
|
matches: string[],
|
|
4762
4428
|
) => void,
|
|
4763
4429
|
): void;
|
|
4764
|
-
function glob(
|
|
4430
|
+
export function glob(
|
|
4765
4431
|
pattern: string | readonly string[],
|
|
4766
4432
|
options: GlobOptions,
|
|
4767
4433
|
callback: (
|
|
@@ -4770,9 +4436,6 @@ declare module "node:fs" {
|
|
|
4770
4436
|
) => void,
|
|
4771
4437
|
): void;
|
|
4772
4438
|
/**
|
|
4773
|
-
* When `followSymlinks` is enabled, detected symbolic link cycles are not
|
|
4774
|
-
* traversed recursively.
|
|
4775
|
-
*
|
|
4776
4439
|
* ```js
|
|
4777
4440
|
* import { globSync } from 'node:fs';
|
|
4778
4441
|
*
|
|
@@ -4781,23 +4444,20 @@ declare module "node:fs" {
|
|
|
4781
4444
|
* @since v22.0.0
|
|
4782
4445
|
* @returns paths of files that match the pattern.
|
|
4783
4446
|
*/
|
|
4784
|
-
function globSync(pattern: string | readonly string[]): string[];
|
|
4785
|
-
function globSync(
|
|
4447
|
+
export function globSync(pattern: string | readonly string[]): string[];
|
|
4448
|
+
export function globSync(
|
|
4786
4449
|
pattern: string | readonly string[],
|
|
4787
4450
|
options: GlobOptionsWithFileTypes,
|
|
4788
4451
|
): Dirent[];
|
|
4789
|
-
function globSync(
|
|
4452
|
+
export function globSync(
|
|
4790
4453
|
pattern: string | readonly string[],
|
|
4791
4454
|
options: GlobOptionsWithoutFileTypes,
|
|
4792
4455
|
): string[];
|
|
4793
|
-
function globSync(
|
|
4456
|
+
export function globSync(
|
|
4794
4457
|
pattern: string | readonly string[],
|
|
4795
4458
|
options: GlobOptions,
|
|
4796
4459
|
): Dirent[] | string[];
|
|
4797
4460
|
}
|
|
4798
4461
|
declare module "node:fs" {
|
|
4799
|
-
export *
|
|
4800
|
-
}
|
|
4801
|
-
declare module "fs" {
|
|
4802
|
-
export * from "node:fs";
|
|
4462
|
+
export * from "fs";
|
|
4803
4463
|
}
|