@psnext/slingcli 3.3.20260911-1 → 3.3.20260914-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/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-VDBOM5UG.js → chunk-BRL3MDQL.js} +1 -1
- 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/dist/modes/interactive/components/model-selector.js +79 -32
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +25 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.js +23 -8
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert/strict.d.ts +13 -56
- package/node_modules/@types/node/assert.d.ts +189 -190
- package/node_modules/@types/node/async_hooks.d.ts +151 -43
- package/node_modules/@types/node/buffer.buffer.d.ts +12 -13
- package/node_modules/@types/node/buffer.d.ts +103 -237
- package/node_modules/@types/node/child_process.d.ts +39 -154
- package/node_modules/@types/node/cluster.d.ts +238 -384
- package/node_modules/@types/node/console.d.ts +45 -404
- package/node_modules/@types/node/constants.d.ts +3 -10
- package/node_modules/@types/node/crypto.d.ts +1000 -1593
- package/node_modules/@types/node/dgram.d.ts +133 -81
- package/node_modules/@types/node/diagnostics_channel.d.ts +277 -59
- package/node_modules/@types/node/dns/promises.d.ts +9 -15
- package/node_modules/@types/node/dns.d.ts +136 -183
- package/node_modules/@types/node/domain.d.ts +12 -32
- package/node_modules/@types/node/events.d.ts +872 -840
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +256 -85
- package/node_modules/@types/node/fs.d.ts +865 -525
- package/node_modules/@types/node/globals.d.ts +12 -34
- package/node_modules/@types/node/globals.typedarray.d.ts +63 -0
- package/node_modules/@types/node/http.d.ts +433 -312
- package/node_modules/@types/node/http2.d.ts +545 -891
- package/node_modules/@types/node/https.d.ts +64 -243
- package/node_modules/@types/node/index.d.ts +25 -7
- package/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@types/node/inspector.d.ts +70 -58
- package/node_modules/@types/node/inspector.generated.d.ts +764 -410
- package/node_modules/@types/node/module.d.ts +54 -219
- package/node_modules/@types/node/net.d.ts +208 -222
- package/node_modules/@types/node/os.d.ts +41 -49
- package/node_modules/@types/node/package.json +13 -3
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +119 -141
- package/node_modules/@types/node/perf_hooks.d.ts +339 -690
- package/node_modules/@types/node/process.d.ts +389 -205
- package/node_modules/@types/node/punycode.d.ts +3 -31
- package/node_modules/@types/node/querystring.d.ts +3 -16
- package/node_modules/@types/node/quic.d.ts +2153 -0
- package/node_modules/@types/node/readline/promises.d.ts +3 -6
- package/node_modules/@types/node/readline.d.ts +66 -152
- package/node_modules/@types/node/repl.d.ts +101 -109
- package/node_modules/@types/node/sea.d.ts +1 -116
- package/node_modules/@types/node/sqlite.d.ts +486 -68
- package/node_modules/@types/node/stream/consumers.d.ts +91 -15
- package/node_modules/@types/node/stream/iter.d.ts +452 -0
- package/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/node/stream/web.d.ts +197 -454
- package/node_modules/@types/node/stream.d.ts +603 -491
- package/node_modules/@types/node/string_decoder.d.ts +3 -43
- package/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@types/node/test.d.ts +513 -292
- package/node_modules/@types/node/timers/promises.d.ts +3 -18
- package/node_modules/@types/node/timers.d.ts +3 -141
- package/node_modules/@types/node/tls.d.ts +166 -257
- package/node_modules/@types/node/trace_events.d.ts +3 -97
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -8
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +2 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +26 -6
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/node_modules/@types/node/tty.d.ts +61 -43
- package/node_modules/@types/node/url.d.ts +156 -584
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +170 -1099
- package/node_modules/@types/node/v8.d.ts +175 -36
- package/node_modules/@types/node/vfs.d.ts +211 -0
- package/node_modules/@types/node/vm.d.ts +292 -209
- package/node_modules/@types/node/wasi.d.ts +24 -74
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +14 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +97 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +257 -407
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@types/node/zlib.d.ts +24 -165
- package/node_modules/undici-types/agent.d.ts +12 -13
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +13 -12
- package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +63 -37
- package/node_modules/undici-types/connector.d.ts +5 -2
- package/node_modules/undici-types/cookies.d.ts +3 -1
- package/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
- package/node_modules/undici-types/dispatcher.d.ts +136 -139
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
- package/node_modules/undici-types/errors.d.ts +92 -54
- package/node_modules/undici-types/eventsource.d.ts +9 -4
- package/node_modules/undici-types/fetch.d.ts +51 -25
- 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/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +10 -9
- package/node_modules/undici-types/header.d.ts +162 -1
- package/node_modules/undici-types/index.d.ts +69 -47
- package/node_modules/undici-types/interceptors.d.ts +72 -9
- package/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +6 -4
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +26 -21
- package/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +0 -4
- 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 +14 -6
- package/node_modules/undici-types/readable.d.ts +19 -16
- package/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/node_modules/undici-types/retry-handler.d.ts +19 -10
- package/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici-types/util.d.ts +3 -3
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +148 -30
- package/node_modules/undici-types/websocket.d.ts +48 -10
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +14 -30
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +1 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +2 -11
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -4
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +1 -1
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +53 -137
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +70 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +87 -35
- package/node_modules/zod/src/v4/core/api.ts +21 -29
- package/node_modules/zod/src/v4/core/checks.ts +61 -1
- package/node_modules/zod/src/v4/core/compile.ts +35 -24
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +9 -63
- package/node_modules/zod/src/v4/core/memoizer.ts +2 -5
- package/node_modules/zod/src/v4/core/regexes.ts +4 -0
- package/node_modules/zod/src/v4/core/schemas.ts +36 -109
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +177 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +1 -1
- package/node_modules/zod/src/v4/core/util.ts +0 -4
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/src/v4/core/visit.ts +0 -11
- 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/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 +1 -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 +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +12 -23
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +56 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +7 -0
- package/node_modules/zod/v4/classic/checks.cjs +2 -1
- 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/schemas.cjs +11 -15
- package/node_modules/zod/v4/classic/schemas.d.cts +4 -6
- package/node_modules/zod/v4/classic/schemas.d.ts +4 -6
- package/node_modules/zod/v4/classic/schemas.js +9 -13
- package/node_modules/zod/v4/core/api.cjs +11 -23
- package/node_modules/zod/v4/core/api.d.cts +8 -4
- package/node_modules/zod/v4/core/api.d.ts +8 -4
- package/node_modules/zod/v4/core/api.js +11 -23
- package/node_modules/zod/v4/core/checks.cjs +32 -1
- package/node_modules/zod/v4/core/checks.d.cts +16 -0
- package/node_modules/zod/v4/core/checks.d.ts +16 -0
- package/node_modules/zod/v4/core/checks.js +31 -0
- package/node_modules/zod/v4/core/compile.cjs +12 -17
- package/node_modules/zod/v4/core/compile.js +13 -18
- package/node_modules/zod/v4/core/core.cjs +1 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/json-schema-processors.cjs +8 -44
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.js +8 -43
- package/node_modules/zod/v4/core/memoizer.cjs +2 -5
- package/node_modules/zod/v4/core/memoizer.js +2 -5
- package/node_modules/zod/v4/core/regexes.cjs +4 -2
- package/node_modules/zod/v4/core/regexes.d.cts +1 -0
- package/node_modules/zod/v4/core/regexes.d.ts +1 -0
- package/node_modules/zod/v4/core/regexes.js +2 -0
- package/node_modules/zod/v4/core/schemas.cjs +33 -73
- package/node_modules/zod/v4/core/schemas.d.cts +7 -22
- package/node_modules/zod/v4/core/schemas.d.ts +7 -22
- package/node_modules/zod/v4/core/schemas.js +30 -72
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -1
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.js +1 -1
- package/node_modules/zod/v4/core/util.cjs +0 -4
- package/node_modules/zod/v4/core/util.js +0 -4
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/node_modules/zod/v4/core/visit.cjs +0 -12
- package/node_modules/zod/v4/core/visit.js +0 -12
- 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/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 +1 -0
- package/node_modules/zod/v4/locales/tg.js +1 -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 +2 -1
- 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/schemas.cjs +11 -13
- package/node_modules/zod/v4/mini/schemas.d.cts +1 -4
- package/node_modules/zod/v4/mini/schemas.d.ts +1 -4
- package/node_modules/zod/v4/mini/schemas.js +9 -11
- package/package.json +2 -2
- package/slingshot/index.js +183 -182
- package/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/undici-types/filereader.d.ts +0 -54
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
declare module "node:ffi" {
|
|
2
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
3
|
+
interface FunctionSignature {
|
|
4
|
+
return?: ReturnType | undefined;
|
|
5
|
+
arguments?: readonly ArgumentType[] | undefined;
|
|
6
|
+
}
|
|
7
|
+
interface FunctionDefinitions {
|
|
8
|
+
[symbol: string]: FunctionSignature;
|
|
9
|
+
}
|
|
10
|
+
type CallbackFunction<R extends ReturnType = any, P extends readonly ArgumentType[] = any[]> = (
|
|
11
|
+
...args: { [K in keyof P]: ArgumentTypeMap[DataTypeMap[P[K]]] }
|
|
12
|
+
) => ReturnTypeMap[DataTypeMap[R]];
|
|
13
|
+
interface WrappedFunction<R extends ReturnType = any, P extends readonly ArgumentType[] = any[]>
|
|
14
|
+
extends CallbackFunction<R, P>
|
|
15
|
+
{
|
|
16
|
+
readonly pointer: bigint;
|
|
17
|
+
}
|
|
18
|
+
type CallbackFunctionFromSignature<T extends FunctionSignature> = CallbackFunction<
|
|
19
|
+
ReturnTypeFromFunctionSignature<T>,
|
|
20
|
+
ArgumentTypesFromFunctionSignature<T>
|
|
21
|
+
>;
|
|
22
|
+
type WrappedFunctionFromSignature<T extends FunctionSignature> = WrappedFunction<
|
|
23
|
+
ReturnTypeFromFunctionSignature<T>,
|
|
24
|
+
ArgumentTypesFromFunctionSignature<T>
|
|
25
|
+
>;
|
|
26
|
+
type WrappedFunctionsFromDefinitions<T extends FunctionDefinitions> = {
|
|
27
|
+
[K in keyof T]: WrappedFunctionFromSignature<T[K]>;
|
|
28
|
+
};
|
|
29
|
+
type ReturnTypeFromFunctionSignature<T extends FunctionSignature> = "return" extends keyof T
|
|
30
|
+
? T extends { return: infer R extends ReturnType } ? R : any
|
|
31
|
+
: "void";
|
|
32
|
+
type ArgumentTypesFromFunctionSignature<T extends FunctionSignature> = "arguments" extends keyof T
|
|
33
|
+
? T extends { arguments: infer P extends readonly ArgumentType[] } ? P : any[]
|
|
34
|
+
: [];
|
|
35
|
+
interface DynamicLibraryResult<T extends FunctionDefinitions> extends Disposable {
|
|
36
|
+
lib: DynamicLibrary;
|
|
37
|
+
functions: WrappedFunctionsFromDefinitions<T>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The native shared library suffix for the current platform:
|
|
41
|
+
*
|
|
42
|
+
* * `'dylib'` on macOS
|
|
43
|
+
* * `'so'` on Unix-like platforms
|
|
44
|
+
* * `'dll'` on Windows
|
|
45
|
+
*
|
|
46
|
+
* This can be used to build portable library paths:
|
|
47
|
+
*
|
|
48
|
+
* ```js
|
|
49
|
+
* const { suffix } = require('node:ffi');
|
|
50
|
+
*
|
|
51
|
+
* const path = `libsqlite3.${suffix}`;
|
|
52
|
+
* ```
|
|
53
|
+
* @since v26.1.0
|
|
54
|
+
*/
|
|
55
|
+
const suffix: string;
|
|
56
|
+
/**
|
|
57
|
+
* Loads a dynamic library and resolves the requested function definitions.
|
|
58
|
+
*
|
|
59
|
+
* On Windows passing `null` is not supported.
|
|
60
|
+
*
|
|
61
|
+
* When `definitions` is omitted, `functions` is returned as an empty object until
|
|
62
|
+
* symbols are resolved explicitly.
|
|
63
|
+
*
|
|
64
|
+
* The returned object also implements the explicit resource management protocol,
|
|
65
|
+
* so it can be used with the `using` declaration. Disposing the returned
|
|
66
|
+
* object closes the library handle.
|
|
67
|
+
*
|
|
68
|
+
* ```js
|
|
69
|
+
* import { dlopen } from 'node:ffi';
|
|
70
|
+
*
|
|
71
|
+
* {
|
|
72
|
+
* using handle = dlopen('./mylib.so', {
|
|
73
|
+
* add_i32: { arguments: ['i32', 'i32'], return: 'i32' },
|
|
74
|
+
* });
|
|
75
|
+
* console.log(handle.functions.add_i32(20, 22));
|
|
76
|
+
* } // handle.lib.close() is invoked automatically here.
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* ```js
|
|
80
|
+
* import { dlopen } from 'node:ffi';
|
|
81
|
+
*
|
|
82
|
+
* const { lib, functions } = dlopen('./mylib.so', {
|
|
83
|
+
* add_i32: { arguments: ['i32', 'i32'], return: 'i32' },
|
|
84
|
+
* string_length: { arguments: ['pointer'], return: 'u64' },
|
|
85
|
+
* });
|
|
86
|
+
*
|
|
87
|
+
* console.log(functions.add_i32(20, 22));
|
|
88
|
+
* ```
|
|
89
|
+
* @since v26.1.0
|
|
90
|
+
* @param path Path to a dynamic library, or `null` to resolve symbols
|
|
91
|
+
* from the current process image.
|
|
92
|
+
* @param definitions Symbol definitions to resolve immediately.
|
|
93
|
+
*/
|
|
94
|
+
function dlopen<const T extends FunctionDefinitions = {}>(
|
|
95
|
+
path: string | null,
|
|
96
|
+
definitions?: T,
|
|
97
|
+
): DynamicLibraryResult<T>;
|
|
98
|
+
/**
|
|
99
|
+
* Closes a dynamic library.
|
|
100
|
+
*
|
|
101
|
+
* This is equivalent to calling `handle.close()`.
|
|
102
|
+
* @since v26.1.0
|
|
103
|
+
*/
|
|
104
|
+
function dlclose(handle: DynamicLibrary): void;
|
|
105
|
+
/**
|
|
106
|
+
* Resolves a symbol address from a loaded library.
|
|
107
|
+
*
|
|
108
|
+
* This is equivalent to calling `handle.getSymbol(symbol)`.
|
|
109
|
+
* @since v26.1.0
|
|
110
|
+
*/
|
|
111
|
+
function dlsym(handle: DynamicLibrary, symbol: string): bigint;
|
|
112
|
+
/**
|
|
113
|
+
* @since v26.1.0
|
|
114
|
+
*/
|
|
115
|
+
class DynamicLibrary {
|
|
116
|
+
/**
|
|
117
|
+
* Loads the dynamic library without resolving any functions eagerly.
|
|
118
|
+
*
|
|
119
|
+
* On Windows passing `null` is not supported.
|
|
120
|
+
*
|
|
121
|
+
* ```js
|
|
122
|
+
* const { DynamicLibrary } = require('node:ffi');
|
|
123
|
+
*
|
|
124
|
+
* const lib = new DynamicLibrary('./mylib.so');
|
|
125
|
+
* ```
|
|
126
|
+
* @param path Path to a dynamic library, or `null` to resolve symbols
|
|
127
|
+
* from the current process image.
|
|
128
|
+
*/
|
|
129
|
+
constructor(path: string | null);
|
|
130
|
+
/**
|
|
131
|
+
* The path used to load the library.
|
|
132
|
+
*/
|
|
133
|
+
readonly path: string;
|
|
134
|
+
/**
|
|
135
|
+
* An object containing previously resolved symbol addresses as `bigint` values.
|
|
136
|
+
*/
|
|
137
|
+
readonly symbols: { [symbol: string]: bigint };
|
|
138
|
+
/**
|
|
139
|
+
* Closes the library handle.
|
|
140
|
+
*
|
|
141
|
+
* `DynamicLibrary` implements the explicit resource management protocol, so a
|
|
142
|
+
* library instance can be managed with the `using` declaration. Leaving the
|
|
143
|
+
* enclosing scope invokes `library.close()` automatically.
|
|
144
|
+
*
|
|
145
|
+
* ```js
|
|
146
|
+
* import { DynamicLibrary } from 'node:ffi';
|
|
147
|
+
*
|
|
148
|
+
* {
|
|
149
|
+
* using lib = new DynamicLibrary('./mylib.so');
|
|
150
|
+
* // Use `lib` here; `lib.close()` is called when the block exits.
|
|
151
|
+
* }
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* Calling `library.close()` (or disposing the library) more than once is a no-op.
|
|
155
|
+
*
|
|
156
|
+
* After a library has been closed:
|
|
157
|
+
*
|
|
158
|
+
* * Resolved function wrappers become invalid.
|
|
159
|
+
* * Further symbol and function resolution throws.
|
|
160
|
+
* * Registered callbacks are invalidated.
|
|
161
|
+
*
|
|
162
|
+
* Closing a library does not make previously exported callback pointers safe to
|
|
163
|
+
* reuse. Node.js does not track or revoke callback pointers that have already
|
|
164
|
+
* been handed to native code.
|
|
165
|
+
*
|
|
166
|
+
* If native code still holds a callback pointer after `library.close()` or after
|
|
167
|
+
* `library.unregisterCallback(pointer)`, invoking that pointer has undefined
|
|
168
|
+
* behavior, is not allowed, and is dangerous: it can crash the process, produce
|
|
169
|
+
* incorrect output, or corrupt memory. Native code must stop using callback
|
|
170
|
+
* addresses before the library is closed or before the callback is unregistered.
|
|
171
|
+
*
|
|
172
|
+
* Calling `library.close()` from one of the library's active callbacks is
|
|
173
|
+
* unsupported and dangerous. The callback must return before the library is
|
|
174
|
+
* closed.
|
|
175
|
+
*/
|
|
176
|
+
close(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Calls `library.close()`. This allows `DynamicLibrary` instances to be used with
|
|
179
|
+
* the `using` declaration for automatic cleanup when the enclosing scope
|
|
180
|
+
* exits. It is a no-op on a library that has already been closed.
|
|
181
|
+
* @since v26.1.0
|
|
182
|
+
*/
|
|
183
|
+
[Symbol.dispose](): void;
|
|
184
|
+
/**
|
|
185
|
+
* Resolves a symbol and returns a callable JavaScript wrapper.
|
|
186
|
+
*
|
|
187
|
+
* The returned function has a `.pointer` property containing the native function
|
|
188
|
+
* address as a `bigint`.
|
|
189
|
+
*
|
|
190
|
+
* If the same symbol has already been resolved, requesting it again with a
|
|
191
|
+
* different signature throws.
|
|
192
|
+
*
|
|
193
|
+
* ```js
|
|
194
|
+
* const { DynamicLibrary } = require('node:ffi');
|
|
195
|
+
*
|
|
196
|
+
* const lib = new DynamicLibrary('./mylib.so');
|
|
197
|
+
* const add = lib.getFunction('add_i32', {
|
|
198
|
+
* arguments: ['i32', 'i32'],
|
|
199
|
+
* return: 'i32',
|
|
200
|
+
* });
|
|
201
|
+
*
|
|
202
|
+
* console.log(add(20, 22));
|
|
203
|
+
* console.log(add.pointer);
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
getFunction<const T extends FunctionSignature>(name: string, signature: T): WrappedFunctionFromSignature<T>;
|
|
207
|
+
/**
|
|
208
|
+
* When `definitions` is provided, resolves each named symbol and returns an
|
|
209
|
+
* object containing callable wrappers.
|
|
210
|
+
*
|
|
211
|
+
* When `definitions` is omitted, returns wrappers for all functions that have
|
|
212
|
+
* already been resolved on the library.
|
|
213
|
+
*/
|
|
214
|
+
getFunctions(): { [symbol: string]: WrappedFunction };
|
|
215
|
+
getFunctions<const T extends FunctionDefinitions>(definitions: T): WrappedFunctionsFromDefinitions<T>;
|
|
216
|
+
/**
|
|
217
|
+
* Resolves a symbol and returns its native address as a `bigint`.
|
|
218
|
+
*/
|
|
219
|
+
getSymbol(name: string): bigint;
|
|
220
|
+
/**
|
|
221
|
+
* Returns an object containing all previously resolved symbol addresses.
|
|
222
|
+
*/
|
|
223
|
+
getSymbols(): Record<string, bigint>;
|
|
224
|
+
/**
|
|
225
|
+
* Creates a native callback pointer backed by a JavaScript function.
|
|
226
|
+
*
|
|
227
|
+
* When `signature` is omitted, the callback uses a default `void ()` signature.
|
|
228
|
+
*
|
|
229
|
+
* The return value is the callback pointer address as a `bigint`. It can be
|
|
230
|
+
* passed to native functions expecting a callback pointer.
|
|
231
|
+
*
|
|
232
|
+
* ```js
|
|
233
|
+
* const { DynamicLibrary } = require('node:ffi');
|
|
234
|
+
*
|
|
235
|
+
* const lib = new DynamicLibrary('./mylib.so');
|
|
236
|
+
*
|
|
237
|
+
* const callback = lib.registerCallback(
|
|
238
|
+
* { arguments: ['i32'], return: 'i32' },
|
|
239
|
+
* (value) => value * 2,
|
|
240
|
+
* );
|
|
241
|
+
* ```
|
|
242
|
+
*
|
|
243
|
+
* Callbacks are subject to the following restrictions:
|
|
244
|
+
*
|
|
245
|
+
* * They must be invoked on the same system thread where they were created.
|
|
246
|
+
* * They must not throw exceptions.
|
|
247
|
+
* * They must not return promises.
|
|
248
|
+
* * They must return a value compatible with the declared return type.
|
|
249
|
+
* * They must not call `library.close()` on their owning library while running.
|
|
250
|
+
* * They must not unregister themselves while running.
|
|
251
|
+
*
|
|
252
|
+
* Closing the owning library or unregistering the currently executing callback
|
|
253
|
+
* from inside the callback is unsupported and dangerous. Doing so may crash the
|
|
254
|
+
* process, produce incorrect output, or corrupt memory.
|
|
255
|
+
*/
|
|
256
|
+
registerCallback(callback: () => void): bigint;
|
|
257
|
+
registerCallback<const T extends FunctionSignature>(
|
|
258
|
+
signature: T,
|
|
259
|
+
callback: CallbackFunctionFromSignature<T>,
|
|
260
|
+
): bigint;
|
|
261
|
+
/**
|
|
262
|
+
* Releases a callback previously created with `library.registerCallback()`.
|
|
263
|
+
*
|
|
264
|
+
* Calling `library.unregisterCallback(pointer)` for a callback that is currently
|
|
265
|
+
* executing is unsupported and dangerous. The callback must return before it is
|
|
266
|
+
* unregistered.
|
|
267
|
+
*
|
|
268
|
+
* After `library.unregisterCallback(pointer)` returns, invoking that callback
|
|
269
|
+
* pointer from native code has undefined behavior, is not allowed, and is
|
|
270
|
+
* dangerous: it can crash the process, produce incorrect output, or corrupt
|
|
271
|
+
* memory.
|
|
272
|
+
*/
|
|
273
|
+
unregisterCallback(pointer: bigint): void;
|
|
274
|
+
/**
|
|
275
|
+
* Keeps the callback strongly referenced by JavaScript.
|
|
276
|
+
*/
|
|
277
|
+
refCallback(pointer: bigint): void;
|
|
278
|
+
/**
|
|
279
|
+
* Allows the callback to become weakly referenced by JavaScript.
|
|
280
|
+
*
|
|
281
|
+
* If the callback function is later garbage collected, subsequent native
|
|
282
|
+
* invocations become a no-op. Non-void return values are zero-initialized before
|
|
283
|
+
* returning to native code.
|
|
284
|
+
*/
|
|
285
|
+
unrefCallback(pointer: bigint): void;
|
|
286
|
+
}
|
|
287
|
+
function getInt8(pointer: bigint, offset?: number): number;
|
|
288
|
+
function getUint8(pointer: bigint, offset?: number): number;
|
|
289
|
+
function getInt16(pointer: bigint, offset?: number): number;
|
|
290
|
+
function getUint16(pointer: bigint, offset?: number): number;
|
|
291
|
+
function getInt32(pointer: bigint, offset?: number): number;
|
|
292
|
+
function getUint32(pointer: bigint, offset?: number): number;
|
|
293
|
+
function getInt64(pointer: bigint, offset?: number): bigint;
|
|
294
|
+
function getUint64(pointer: bigint, offset?: number): bigint;
|
|
295
|
+
function getFloat32(pointer: bigint, offset?: number): number;
|
|
296
|
+
function getFloat64(pointer: bigint, offset?: number): number;
|
|
297
|
+
function setInt8(pointer: bigint, offset: number, value: number): void;
|
|
298
|
+
function setUint8(pointer: bigint, offset: number, value: number): void;
|
|
299
|
+
function setInt16(pointer: bigint, offset: number, value: number): void;
|
|
300
|
+
function setUint16(pointer: bigint, offset: number, value: number): void;
|
|
301
|
+
function setInt32(pointer: bigint, offset: number, value: number): void;
|
|
302
|
+
function setUint32(pointer: bigint, offset: number, value: number): void;
|
|
303
|
+
function setInt64(pointer: bigint, offset: number, value: number | bigint): void;
|
|
304
|
+
function setUint64(pointer: bigint, offset: number, value: number | bigint): void;
|
|
305
|
+
function setFloat32(pointer: bigint, offset: number, value: number): void;
|
|
306
|
+
function setFloat64(pointer: bigint, offset: number, value: number): void;
|
|
307
|
+
/**
|
|
308
|
+
* Reads a NUL-terminated UTF-8 string from native memory.
|
|
309
|
+
*
|
|
310
|
+
* If `pointer` is `0n`, `null` is returned.
|
|
311
|
+
*
|
|
312
|
+
* This function does not validate that `pointer` refers to readable memory or
|
|
313
|
+
* that the pointed-to data is terminated with `\0`. Passing an invalid pointer,
|
|
314
|
+
* a pointer to freed memory, or a pointer to bytes without a terminating NUL can
|
|
315
|
+
* read unrelated memory, crash the process, or produce truncated or garbled
|
|
316
|
+
* output.
|
|
317
|
+
* @since v26.1.0
|
|
318
|
+
*/
|
|
319
|
+
function toString(pointer: bigint): string | null;
|
|
320
|
+
/**
|
|
321
|
+
* Creates a `Buffer` from native memory.
|
|
322
|
+
*
|
|
323
|
+
* When `copy` is `true`, the returned `Buffer` owns its own copied memory.
|
|
324
|
+
* When `copy` is `false`, the returned `Buffer` references the original native
|
|
325
|
+
* memory directly.
|
|
326
|
+
*
|
|
327
|
+
* Using `copy: false` is a zero-copy escape hatch. The returned `Buffer` is a
|
|
328
|
+
* writable view onto foreign memory, so writes in JavaScript update the original
|
|
329
|
+
* native memory directly. The caller must guarantee that:
|
|
330
|
+
*
|
|
331
|
+
* * `pointer` remains valid for the entire lifetime of the returned `Buffer`.
|
|
332
|
+
* * `length` stays within the allocated native region.
|
|
333
|
+
* * no native code frees or repurposes that memory while JavaScript still uses
|
|
334
|
+
* the `Buffer`.
|
|
335
|
+
* * Memory protection is observed. For example, read-only memory pages must not
|
|
336
|
+
* be written to.
|
|
337
|
+
*
|
|
338
|
+
* If these guarantees are not met, reading or writing the `Buffer` can corrupt
|
|
339
|
+
* memory or crash the process.
|
|
340
|
+
* @since v26.1.0
|
|
341
|
+
* @param copy When `false`, creates a zero-copy view. **Default:** `true`.
|
|
342
|
+
*/
|
|
343
|
+
function toBuffer(pointer: bigint, length: number, copy?: boolean): NonSharedBuffer;
|
|
344
|
+
/**
|
|
345
|
+
* Creates an `ArrayBuffer` from native memory.
|
|
346
|
+
*
|
|
347
|
+
* When `copy` is `true`, the returned `ArrayBuffer` contains copied bytes.
|
|
348
|
+
* When `copy` is `false`, the returned `ArrayBuffer` references the original
|
|
349
|
+
* native memory directly.
|
|
350
|
+
*
|
|
351
|
+
* The same lifetime and bounds requirements described for
|
|
352
|
+
* `ffi.toBuffer(pointer, length, copy)` apply
|
|
353
|
+
* here. With `copy: false`, the
|
|
354
|
+
* returned `ArrayBuffer` is a zero-copy view of foreign memory and is only safe
|
|
355
|
+
* while that memory remains allocated, unchanged in layout, and valid for the
|
|
356
|
+
* entire exposed range.
|
|
357
|
+
* @since v26.1.0
|
|
358
|
+
* @param copy When `false`, creates a zero-copy view. **Default:** `true`.
|
|
359
|
+
*/
|
|
360
|
+
function toArrayBuffer(pointer: bigint, length: number, copy?: boolean): ArrayBuffer;
|
|
361
|
+
/**
|
|
362
|
+
* Copies a JavaScript string into native memory and appends a trailing NUL
|
|
363
|
+
* terminator.
|
|
364
|
+
*
|
|
365
|
+
* `length` must be large enough to hold the full encoded string plus the trailing
|
|
366
|
+
* NUL terminator. For UTF-16 and UCS-2 encodings, the trailing terminator uses
|
|
367
|
+
* two zero bytes.
|
|
368
|
+
*
|
|
369
|
+
* `pointer` must refer to writable native memory with at least `length` bytes of
|
|
370
|
+
* available storage. This function does not allocate memory on its own.
|
|
371
|
+
*
|
|
372
|
+
* `string` must be a JavaScript string. `encoding` must be a string.
|
|
373
|
+
* @since v26.1.0
|
|
374
|
+
* @param encoding **Default:** `'utf8'`.
|
|
375
|
+
*/
|
|
376
|
+
function exportString(string: string, pointer: bigint, length: number, encoding?: BufferEncoding): void;
|
|
377
|
+
/**
|
|
378
|
+
* Copies bytes from a `Buffer` into native memory.
|
|
379
|
+
*
|
|
380
|
+
* `length` must be at least `buffer.length`.
|
|
381
|
+
*
|
|
382
|
+
* `pointer` must refer to writable native memory with at least `length` bytes of
|
|
383
|
+
* available storage. This function does not allocate memory on its own.
|
|
384
|
+
*
|
|
385
|
+
* `buffer` must be a Node.js `Buffer`.
|
|
386
|
+
* @since v26.1.0
|
|
387
|
+
*/
|
|
388
|
+
function exportBuffer(buffer: Buffer, pointer: bigint, length: number): void;
|
|
389
|
+
/**
|
|
390
|
+
* Copies bytes from an `ArrayBuffer` into native memory.
|
|
391
|
+
*
|
|
392
|
+
* `length` must be at least `arrayBuffer.byteLength`.
|
|
393
|
+
*
|
|
394
|
+
* `pointer` must refer to writable native memory with at least `length` bytes of
|
|
395
|
+
* available storage. This function does not allocate memory on its own.
|
|
396
|
+
* @since v26.1.0
|
|
397
|
+
*/
|
|
398
|
+
function exportArrayBuffer(arrayBuffer: ArrayBuffer, pointer: bigint, length: number): void;
|
|
399
|
+
/**
|
|
400
|
+
* Copies bytes from an `ArrayBufferView` into native memory.
|
|
401
|
+
*
|
|
402
|
+
* `length` must be at least `arrayBufferView.byteLength`.
|
|
403
|
+
*
|
|
404
|
+
* `pointer` must refer to writable native memory with at least `length` bytes of
|
|
405
|
+
* available storage. This function does not allocate memory on its own.
|
|
406
|
+
* @since v26.1.0
|
|
407
|
+
*/
|
|
408
|
+
function exportArrayBufferView(arrayBufferView: NodeJS.ArrayBufferView, pointer: bigint, length: number): void;
|
|
409
|
+
/**
|
|
410
|
+
* Returns the raw memory address of JavaScript-managed byte storage.
|
|
411
|
+
*
|
|
412
|
+
* This is unsafe and dangerous. The returned pointer can become invalid if the
|
|
413
|
+
* underlying memory is detached, resized, transferred, or otherwise invalidated.
|
|
414
|
+
* Using stale pointers can cause memory corruption or process crashes.
|
|
415
|
+
* @since v26.1.0
|
|
416
|
+
*/
|
|
417
|
+
function getRawPointer(source: ArrayBuffer | NodeJS.ArrayBufferView): bigint;
|
|
418
|
+
type ReturnType = { [K in keyof DataTypeMap]: K }[keyof DataTypeMap];
|
|
419
|
+
type ArgumentType = Exclude<ReturnType, "void">;
|
|
420
|
+
interface DataTypeMap {
|
|
421
|
+
void: "void";
|
|
422
|
+
char: "number";
|
|
423
|
+
bool: "number";
|
|
424
|
+
i8: "number";
|
|
425
|
+
int8: "number";
|
|
426
|
+
u8: "number";
|
|
427
|
+
uint8: "number";
|
|
428
|
+
i16: "number";
|
|
429
|
+
int16: "number";
|
|
430
|
+
u16: "number";
|
|
431
|
+
uint16: "number";
|
|
432
|
+
i32: "number";
|
|
433
|
+
int32: "number";
|
|
434
|
+
u32: "number";
|
|
435
|
+
uint32: "number";
|
|
436
|
+
i64: "bigint";
|
|
437
|
+
int64: "bigint";
|
|
438
|
+
u64: "bigint";
|
|
439
|
+
uint64: "bigint";
|
|
440
|
+
float: "number";
|
|
441
|
+
f32: "number";
|
|
442
|
+
double: "number";
|
|
443
|
+
f64: "number";
|
|
444
|
+
pointer: "pointer";
|
|
445
|
+
ptr: "pointer";
|
|
446
|
+
function: "pointer";
|
|
447
|
+
buffer: "pointer";
|
|
448
|
+
arraybuffer: "pointer";
|
|
449
|
+
string: "pointer";
|
|
450
|
+
str: "pointer";
|
|
451
|
+
}
|
|
452
|
+
interface ArgumentTypeMap {
|
|
453
|
+
"number": number;
|
|
454
|
+
"bigint": bigint;
|
|
455
|
+
"pointer": bigint | string | ArrayBuffer | NodeJS.ArrayBufferView | null;
|
|
456
|
+
}
|
|
457
|
+
interface ReturnTypeMap {
|
|
458
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
459
|
+
"void": void;
|
|
460
|
+
"number": number;
|
|
461
|
+
"bigint": bigint;
|
|
462
|
+
"pointer": bigint;
|
|
463
|
+
}
|
|
464
|
+
enum types {
|
|
465
|
+
VOID = "void",
|
|
466
|
+
POINTER = "pointer",
|
|
467
|
+
BUFFER = "buffer",
|
|
468
|
+
ARRAY_BUFFER = "arraybuffer",
|
|
469
|
+
FUNCTION = "function",
|
|
470
|
+
BOOL = "bool",
|
|
471
|
+
CHAR = "char",
|
|
472
|
+
STRING = "string",
|
|
473
|
+
FLOAT = "float",
|
|
474
|
+
DOUBLE = "double",
|
|
475
|
+
INT_8 = "int8",
|
|
476
|
+
UINT_8 = "uint8",
|
|
477
|
+
INT_16 = "int16",
|
|
478
|
+
UINT_16 = "uint16",
|
|
479
|
+
INT_32 = "int32",
|
|
480
|
+
UINT_32 = "uint32",
|
|
481
|
+
INT_64 = "int64",
|
|
482
|
+
UINT_64 = "uint64",
|
|
483
|
+
FLOAT_32 = "float32",
|
|
484
|
+
FLOAT_64 = "float64",
|
|
485
|
+
}
|
|
486
|
+
}
|