@daniel156161/prism 0.2.101 → 0.2.105
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/README.md +2 -2
- package/dist/pi/pi-env.d.ts +1 -1
- package/dist/pi/pi-env.js +1 -1
- package/dist/prism-extensions/integrations/ai-memory-system.js +16 -9
- package/dist/prism-extensions/integrations/ai-memory-system.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +23 -25
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +3 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +3 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +38 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +75 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +75 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/deepseek.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-client/CHANGELOG.md +1 -1
- package/node_modules/@earendil-works/pi-client/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +47 -3
- package/node_modules/@earendil-works/pi-coding-agent/README.md +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-GPPBJGBU.js → chunk-2KVJKXS2.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-E5KXRMZK.js → chunk-OMWWHBTG.js} +69 -68
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-generative-ai-XDKMGBCJ.js → google-generative-ai-YMUPJBKR.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-vertex-D5FGEO3Y.js → google-vertex-MPWMV4OF.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{mistral-conversations-YK73UAOZ.js → mistral-conversations-Q3AWZJAZ.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-completions-JD4WAC3R.js → openai-completions-ERMU2SS7.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/cli/startup-ui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +12 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +77 -9
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +19 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +45 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +4 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +8 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +17 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.d.ts +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.d.ts +3 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js +27 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +55 -31
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/shell.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/shell.js +6 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/shell.js.map +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/compaction.md +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/custom-provider.md +7 -7
- package/node_modules/@earendil-works/pi-coding-agent/docs/environment-variables.md +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +18 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/quickstart.md +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +23 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +12 -4
- package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/docs/usage.md +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
- package/node_modules/@earendil-works/pi-protocol/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +36 -3
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +37 -2
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +11 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +58 -15
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +105 -45
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.buffer.d.ts +5 -0
- package/node_modules/@types/node/crypto.d.ts +0 -2
- package/node_modules/@types/node/dgram.d.ts +119 -4
- package/node_modules/@types/node/fs/promises.d.ts +61 -65
- package/node_modules/@types/node/fs.d.ts +86 -76
- package/node_modules/@types/node/http.d.ts +1 -1
- package/node_modules/@types/node/http2.d.ts +2 -2
- package/node_modules/@types/node/index.d.ts +1 -0
- package/node_modules/@types/node/inspector.d.ts +2 -1
- package/node_modules/@types/node/net.d.ts +108 -16
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/quic.d.ts +37 -11
- package/node_modules/@types/node/stream/iter.d.ts +4 -4
- package/node_modules/@types/node/tls.d.ts +24 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +5 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
- package/node_modules/@types/node/tty.d.ts +4 -3
- package/node_modules/@types/node/vfs.d.ts +210 -0
- package/node_modules/@types/node/vm.d.ts +1 -1
- package/package.json +9 -9
- package/src/prism-extensions/integrations/ai-memory-system.ts +14 -9
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/dist-RDWOYWHR.js +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare module "node:fs" {
|
|
2
|
-
import { NonSharedBuffer } from "node:buffer";
|
|
2
|
+
import { BufferView, NonSharedBuffer } from "node:buffer";
|
|
3
3
|
import { Abortable, EventEmitter, InternalEventEmitter } from "node:events";
|
|
4
4
|
import { FileHandle } from "node:fs/promises";
|
|
5
5
|
import * as stream from "node:stream";
|
|
@@ -3029,6 +3029,19 @@ declare module "node:fs" {
|
|
|
3029
3029
|
* If no `options` object is specified, it will default with the above values.
|
|
3030
3030
|
*/
|
|
3031
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
|
+
}
|
|
3032
3045
|
/**
|
|
3033
3046
|
* Asynchronously reads the entire contents of a file.
|
|
3034
3047
|
*
|
|
@@ -3046,6 +3059,11 @@ declare module "node:fs" {
|
|
|
3046
3059
|
*
|
|
3047
3060
|
* If no encoding is specified, then the raw buffer is returned.
|
|
3048
3061
|
*
|
|
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
|
+
*
|
|
3049
3067
|
* If `options` is a string, then it specifies the encoding:
|
|
3050
3068
|
*
|
|
3051
3069
|
* ```js
|
|
@@ -3054,7 +3072,8 @@ declare module "node:fs" {
|
|
|
3054
3072
|
* readFile('/etc/passwd', 'utf8', callback);
|
|
3055
3073
|
* ```
|
|
3056
3074
|
*
|
|
3057
|
-
* When the path is a directory, the behavior of `fs.readFile()` and
|
|
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
|
|
3058
3077
|
* error will be returned. On FreeBSD, a representation of the directory's contents
|
|
3059
3078
|
* will be returned.
|
|
3060
3079
|
*
|
|
@@ -3092,60 +3111,56 @@ declare module "node:fs" {
|
|
|
3092
3111
|
*
|
|
3093
3112
|
* Aborting an ongoing request does not abort individual operating
|
|
3094
3113
|
* 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
|
+
* ```
|
|
3095
3141
|
* @since v0.1.29
|
|
3096
3142
|
* @param path filename or file descriptor
|
|
3097
3143
|
*/
|
|
3144
|
+
function readFile<T extends NodeJS.ArrayBufferView>(
|
|
3145
|
+
path: PathOrFileDescriptor,
|
|
3146
|
+
options: ReadFileOptionsWithBuffer<T>,
|
|
3147
|
+
callback: (err: NodeJS.ErrnoException | null, data: BufferView<T>) => void,
|
|
3148
|
+
): void;
|
|
3098
3149
|
function readFile(
|
|
3099
3150
|
path: PathOrFileDescriptor,
|
|
3100
|
-
options:
|
|
3101
|
-
| ({
|
|
3102
|
-
encoding?: null | undefined;
|
|
3103
|
-
flag?: string | undefined;
|
|
3104
|
-
} & Abortable)
|
|
3105
|
-
| undefined
|
|
3106
|
-
| null,
|
|
3151
|
+
options: ReadFileOptionsWithBufferEncoding | null | undefined,
|
|
3107
3152
|
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
|
3108
3153
|
): void;
|
|
3109
|
-
/**
|
|
3110
|
-
* Asynchronously reads the entire contents of a file.
|
|
3111
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3112
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3113
|
-
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
3114
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
3115
|
-
*/
|
|
3116
3154
|
function readFile(
|
|
3117
3155
|
path: PathOrFileDescriptor,
|
|
3118
|
-
options:
|
|
3119
|
-
| ({
|
|
3120
|
-
encoding: BufferEncoding;
|
|
3121
|
-
flag?: string | undefined;
|
|
3122
|
-
} & Abortable)
|
|
3123
|
-
| BufferEncoding,
|
|
3156
|
+
options: ReadFileOptionsWithStringEncoding | BufferEncoding,
|
|
3124
3157
|
callback: (err: NodeJS.ErrnoException | null, data: string) => void,
|
|
3125
3158
|
): void;
|
|
3126
|
-
/**
|
|
3127
|
-
* Asynchronously reads the entire contents of a file.
|
|
3128
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3129
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3130
|
-
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
3131
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
3132
|
-
*/
|
|
3133
3159
|
function readFile(
|
|
3134
3160
|
path: PathOrFileDescriptor,
|
|
3135
|
-
options:
|
|
3136
|
-
| (ObjectEncodingOptions & {
|
|
3137
|
-
flag?: string | undefined;
|
|
3138
|
-
} & Abortable)
|
|
3139
|
-
| BufferEncoding
|
|
3140
|
-
| undefined
|
|
3141
|
-
| null,
|
|
3161
|
+
options: ReadFileOptions | BufferEncoding | null | undefined,
|
|
3142
3162
|
callback: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,
|
|
3143
3163
|
): void;
|
|
3144
|
-
/**
|
|
3145
|
-
* Asynchronously reads the entire contents of a file.
|
|
3146
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3147
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3148
|
-
*/
|
|
3149
3164
|
function readFile(
|
|
3150
3165
|
path: PathOrFileDescriptor,
|
|
3151
3166
|
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
|
@@ -3200,16 +3215,37 @@ declare module "node:fs" {
|
|
|
3200
3215
|
| null,
|
|
3201
3216
|
): Promise<string | NonSharedBuffer>;
|
|
3202
3217
|
}
|
|
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
|
+
}
|
|
3203
3233
|
/**
|
|
3204
3234
|
* Returns the contents of the `path`.
|
|
3205
3235
|
*
|
|
3206
3236
|
* For detailed information, see the documentation of the asynchronous version of
|
|
3207
|
-
* this API:
|
|
3237
|
+
* this API: `fs.readFile()`.
|
|
3208
3238
|
*
|
|
3209
3239
|
* If the `encoding` option is specified then this function returns a
|
|
3210
3240
|
* string. Otherwise it returns a buffer.
|
|
3211
3241
|
*
|
|
3212
|
-
*
|
|
3242
|
+
* If `buffer` is provided and no encoding is specified, the returned {Buffer} is
|
|
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.
|
|
3213
3249
|
*
|
|
3214
3250
|
* ```js
|
|
3215
3251
|
* import { readFileSync } from 'node:fs';
|
|
@@ -3224,45 +3260,19 @@ declare module "node:fs" {
|
|
|
3224
3260
|
* @since v0.1.8
|
|
3225
3261
|
* @param path filename or file descriptor
|
|
3226
3262
|
*/
|
|
3263
|
+
function readFileSync<T extends NodeJS.ArrayBufferView>(
|
|
3264
|
+
path: PathOrFileDescriptor,
|
|
3265
|
+
options: ReadFileSyncOptionsWithBuffer<T>,
|
|
3266
|
+
): BufferView<T>;
|
|
3227
3267
|
function readFileSync(
|
|
3228
3268
|
path: PathOrFileDescriptor,
|
|
3229
|
-
options?:
|
|
3230
|
-
encoding?: null | undefined;
|
|
3231
|
-
flag?: string | undefined;
|
|
3232
|
-
} | null,
|
|
3269
|
+
options?: ReadFileSyncOptionsWithBufferEncoding | null,
|
|
3233
3270
|
): NonSharedBuffer;
|
|
3234
|
-
/**
|
|
3235
|
-
* Synchronously reads the entire contents of a file.
|
|
3236
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3237
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3238
|
-
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
3239
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
3240
|
-
*/
|
|
3241
3271
|
function readFileSync(
|
|
3242
3272
|
path: PathOrFileDescriptor,
|
|
3243
|
-
options:
|
|
3244
|
-
| {
|
|
3245
|
-
encoding: BufferEncoding;
|
|
3246
|
-
flag?: string | undefined;
|
|
3247
|
-
}
|
|
3248
|
-
| BufferEncoding,
|
|
3273
|
+
options: ReadFileSyncOptionsWithStringEncoding | BufferEncoding,
|
|
3249
3274
|
): string;
|
|
3250
|
-
|
|
3251
|
-
* Synchronously reads the entire contents of a file.
|
|
3252
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
3253
|
-
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
|
|
3254
|
-
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
3255
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
3256
|
-
*/
|
|
3257
|
-
function readFileSync(
|
|
3258
|
-
path: PathOrFileDescriptor,
|
|
3259
|
-
options?:
|
|
3260
|
-
| (ObjectEncodingOptions & {
|
|
3261
|
-
flag?: string | undefined;
|
|
3262
|
-
})
|
|
3263
|
-
| BufferEncoding
|
|
3264
|
-
| null,
|
|
3265
|
-
): string | NonSharedBuffer;
|
|
3275
|
+
function readFileSync(path: PathOrFileDescriptor, options: ReadFileSyncOptions): string | NonSharedBuffer;
|
|
3266
3276
|
type WriteFileOptions =
|
|
3267
3277
|
| (
|
|
3268
3278
|
& ObjectEncodingOptions
|
|
@@ -299,7 +299,7 @@ declare module "node:http" {
|
|
|
299
299
|
requireHostHeader?: boolean | undefined;
|
|
300
300
|
/**
|
|
301
301
|
* If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
|
|
302
|
-
* similarly on what is done in `socket.setKeepAlive(
|
|
302
|
+
* similarly on what is done in `socket.setKeepAlive()`.
|
|
303
303
|
* @default false
|
|
304
304
|
* @since v16.5.0
|
|
305
305
|
*/
|
|
@@ -433,7 +433,7 @@ declare module "node:http2" {
|
|
|
433
433
|
*
|
|
434
434
|
* When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
|
|
435
435
|
* will be emitted immediately after queuing the last chunk of payload data to be
|
|
436
|
-
* sent. The `http2stream.sendTrailers()` method can then be used to
|
|
436
|
+
* sent. The `http2stream.sendTrailers()` method can then be used to send trailing
|
|
437
437
|
* header fields to the peer.
|
|
438
438
|
*
|
|
439
439
|
* When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
|
|
@@ -548,7 +548,7 @@ declare module "node:http2" {
|
|
|
548
548
|
*
|
|
549
549
|
* When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
|
|
550
550
|
* will be emitted immediately after queuing the last chunk of payload data to be
|
|
551
|
-
* sent. The `http2stream.sendTrailers()` method can then be used to
|
|
551
|
+
* sent. The `http2stream.sendTrailers()` method can then be used to send trailing
|
|
552
552
|
* header fields to the peer.
|
|
553
553
|
*
|
|
554
554
|
* When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
/// <reference path="util.d.ts" />
|
|
109
109
|
/// <reference path="util/types.d.ts" />
|
|
110
110
|
/// <reference path="v8.d.ts" />
|
|
111
|
+
/// <reference path="vfs.d.ts" />
|
|
111
112
|
/// <reference path="vm.d.ts" />
|
|
112
113
|
/// <reference path="wasi.d.ts" />
|
|
113
114
|
/// <reference path="worker_threads.d.ts" />
|
|
@@ -43,7 +43,8 @@ declare module "node:inspector" {
|
|
|
43
43
|
*/
|
|
44
44
|
function open(port?: number, host?: string, wait?: boolean): Disposable;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Deactivates the inspector. If there are active connections, they are forcibly
|
|
47
|
+
* terminated. Blocks until the inspector server has fully stopped.
|
|
47
48
|
*/
|
|
48
49
|
function close(): void;
|
|
49
50
|
/**
|
|
@@ -25,6 +25,7 @@ declare module "node:net" {
|
|
|
25
25
|
keepAliveInitialDelay?: number | undefined;
|
|
26
26
|
blockList?: BlockList | undefined;
|
|
27
27
|
typeOfService?: number | undefined;
|
|
28
|
+
handle?: BoundSocket | undefined;
|
|
28
29
|
}
|
|
29
30
|
interface OnReadOpts {
|
|
30
31
|
buffer: Uint8Array | (() => Uint8Array);
|
|
@@ -57,6 +58,12 @@ declare module "node:net" {
|
|
|
57
58
|
}
|
|
58
59
|
type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
|
|
59
60
|
type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed";
|
|
61
|
+
interface SetKeepAliveOptions {
|
|
62
|
+
enable?: boolean | undefined;
|
|
63
|
+
initialDelay?: number | undefined;
|
|
64
|
+
interval?: number | undefined;
|
|
65
|
+
count?: number | undefined;
|
|
66
|
+
}
|
|
60
67
|
interface SocketEventMap extends Omit<stream.DuplexEventMap, "close"> {
|
|
61
68
|
"close": [hadError: boolean];
|
|
62
69
|
"connect": [];
|
|
@@ -199,25 +206,27 @@ declare module "node:net" {
|
|
|
199
206
|
*/
|
|
200
207
|
setNoDelay(noDelay?: boolean): this;
|
|
201
208
|
/**
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* Set `initialDelay` (in milliseconds) to set the delay between the last
|
|
206
|
-
* data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default
|
|
207
|
-
* (or previous) setting.
|
|
208
|
-
*
|
|
209
|
-
* Enabling the keep-alive functionality will set the following socket options:
|
|
209
|
+
* Configure keep-alive using an options object. See `socket.setKeepAlive()`
|
|
210
|
+
* for a description of each property.
|
|
210
211
|
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
212
|
+
* ```js
|
|
213
|
+
* socket.setKeepAlive({ enable: true, initialDelay: 1000, interval: 1000, count: 10 });
|
|
214
|
+
* ```
|
|
215
|
+
* @since v26.4.0
|
|
216
|
+
* @returns The socket itself.
|
|
217
|
+
*/
|
|
218
|
+
setKeepAlive(options: SetKeepAliveOptions): this;
|
|
219
|
+
/**
|
|
220
|
+
* Configure keep-alive using positional arguments. See
|
|
221
|
+
* `socket.setKeepAlive()` for a description of each argument.
|
|
215
222
|
* @since v0.1.92
|
|
216
|
-
* @param
|
|
217
|
-
* @param
|
|
218
|
-
* @
|
|
223
|
+
* @param enable **Default:** `false`
|
|
224
|
+
* @param initialDelay **Default:** `0`
|
|
225
|
+
* @param interval **Default:** `1000`
|
|
226
|
+
* @param count **Default:** `10`
|
|
227
|
+
* @returns The socket itself.
|
|
219
228
|
*/
|
|
220
|
-
setKeepAlive(enable?: boolean, initialDelay?: number): this;
|
|
229
|
+
setKeepAlive(enable?: boolean, initialDelay?: number, interval?: number, count?: number): this;
|
|
221
230
|
/**
|
|
222
231
|
* Returns the current Type of Service (TOS) field for IPv4 packets or Traffic
|
|
223
232
|
* Class for IPv6 packets for this socket.
|
|
@@ -442,9 +451,92 @@ declare module "node:net" {
|
|
|
442
451
|
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
443
452
|
// #endregion
|
|
444
453
|
}
|
|
454
|
+
interface BoundSocketOptions {
|
|
455
|
+
/**
|
|
456
|
+
* Local address to bind. Must be a numeric IP literal; no DNS
|
|
457
|
+
* resolution is performed. **Default:** `'0.0.0.0'`, or `'::'` when
|
|
458
|
+
* `ipv6Only` is `true`.
|
|
459
|
+
*/
|
|
460
|
+
host?: string | undefined;
|
|
461
|
+
/**
|
|
462
|
+
* Local port. `0` requests an OS-assigned ephemeral port.
|
|
463
|
+
* **Default:** `0`.
|
|
464
|
+
*/
|
|
465
|
+
port?: number | undefined;
|
|
466
|
+
/**
|
|
467
|
+
* Sets `IPV6_V6ONLY`, disabling dual-stack support so the
|
|
468
|
+
* socket binds IPv6 only. Only meaningful for IPv6 binds. **Default:**
|
|
469
|
+
* `false`.
|
|
470
|
+
*/
|
|
471
|
+
ipv6Only?: boolean | undefined;
|
|
472
|
+
/**
|
|
473
|
+
* Sets `SO_REUSEPORT`, allowing multiple sockets to bind
|
|
474
|
+
* the same address and port for kernel-level load balancing. Support is
|
|
475
|
+
* platform-dependent. **Default:** `false`.
|
|
476
|
+
*/
|
|
477
|
+
reusePort?: boolean | undefined;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Allows for the synchronous creation of a pre-bound socket, that can be passed
|
|
481
|
+
* to `listen()` or `new net.Socket()` later on. For `listen()` this enables
|
|
482
|
+
* synchronous port reservation, while for `new net.Socket()`, it allows control
|
|
483
|
+
* over the local egress port/IP, via `bind(2)` semantics.
|
|
484
|
+
*
|
|
485
|
+
* Adoption transfers ownership of the socket; afterwards `address()` and `close()`
|
|
486
|
+
* throw `ERR_SOCKET_HANDLE_ADOPTED`. A handle that is never adopted must be
|
|
487
|
+
* closed to avoid leaking the socket.
|
|
488
|
+
*
|
|
489
|
+
* ```js
|
|
490
|
+
* import net from 'node:net';
|
|
491
|
+
*
|
|
492
|
+
* const bound = new net.BoundSocket();
|
|
493
|
+
* const { port } = bound.address();
|
|
494
|
+
* console.log(`Reserved port ${port} for server`);
|
|
495
|
+
*
|
|
496
|
+
* const server = net.createServer();
|
|
497
|
+
* server.listen(bound); // Adopt as a server, or pass to new net.Socket() instead.
|
|
498
|
+
* ```
|
|
499
|
+
* @since v26.4.0
|
|
500
|
+
*/
|
|
501
|
+
class BoundSocket {
|
|
502
|
+
/**
|
|
503
|
+
* @since v26.4.0
|
|
504
|
+
*/
|
|
505
|
+
constructor(options?: BoundSocketOptions);
|
|
506
|
+
/**
|
|
507
|
+
* Returns the bound local address. When bound with `port: 0`, `port` is the
|
|
508
|
+
* OS-assigned ephemeral port.
|
|
509
|
+
* @since v26.4.0
|
|
510
|
+
* @returns An object with `address`, `family`, and `port` properties,
|
|
511
|
+
* as `server.address()` returns.
|
|
512
|
+
*/
|
|
513
|
+
address(): AddressInfo;
|
|
514
|
+
/**
|
|
515
|
+
* Returns the file descriptor of the bound socket. Ownership remains with the
|
|
516
|
+
* `BoundSocket`, so the descriptor must not be closed by the caller. The
|
|
517
|
+
* descriptor is only available before the handle is adopted; afterwards it belongs
|
|
518
|
+
* to the adopting `net.Server` or `net.Socket` and `fd()` throws
|
|
519
|
+
* `ERR_SOCKET_HANDLE_ADOPTED`.
|
|
520
|
+
* @since v26.4.0
|
|
521
|
+
* @returns The underlying OS file descriptor, or `-1` on platforms
|
|
522
|
+
* that do not expose one for sockets (such as Windows).
|
|
523
|
+
*/
|
|
524
|
+
fd(): number;
|
|
525
|
+
/**
|
|
526
|
+
* Releases the bound socket. Only needed when the handle is never adopted.
|
|
527
|
+
* @since v26.4.0
|
|
528
|
+
*/
|
|
529
|
+
close(): void;
|
|
530
|
+
/**
|
|
531
|
+
* Closes the handle if it has not been adopted or closed; otherwise a no-op.
|
|
532
|
+
* @since v26.4.0
|
|
533
|
+
*/
|
|
534
|
+
[Symbol.dispose](): void;
|
|
535
|
+
}
|
|
445
536
|
interface ListenOptions extends Abortable {
|
|
446
537
|
backlog?: number | undefined;
|
|
447
538
|
exclusive?: boolean | undefined;
|
|
539
|
+
handle?: BoundSocket | undefined;
|
|
448
540
|
host?: string | undefined;
|
|
449
541
|
/**
|
|
450
542
|
* @default false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.4.0",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~8.3.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "0793b8d36264e159c56982e4bc1d7024a8a703b13431ee414c7feacfe570e674",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare module "node:quic" {
|
|
2
2
|
import { NonSharedBuffer } from "node:buffer";
|
|
3
|
-
import { KeyObject } from "node:crypto";
|
|
3
|
+
import { KeyObject, X509Certificate } from "node:crypto";
|
|
4
4
|
import { FileHandle } from "node:fs/promises";
|
|
5
5
|
import { BlockList, SocketAddress } from "node:net";
|
|
6
6
|
import { Writer } from "node:stream/iter";
|
|
7
|
-
import { EphemeralKeyInfo
|
|
7
|
+
import { EphemeralKeyInfo } from "node:tls";
|
|
8
8
|
/**
|
|
9
9
|
* @since v23.8.0
|
|
10
10
|
*/
|
|
@@ -25,6 +25,10 @@ declare module "node:quic" {
|
|
|
25
25
|
id: bigint,
|
|
26
26
|
status: "acknowledged" | "lost" | "abandoned",
|
|
27
27
|
) => void;
|
|
28
|
+
/**
|
|
29
|
+
* @since v23.8.0
|
|
30
|
+
*/
|
|
31
|
+
type OnApplicationCallback = (this: QuicSession, applicationoptions: SessionApplicationOptions) => void;
|
|
28
32
|
/**
|
|
29
33
|
* @since v23.8.0
|
|
30
34
|
*/
|
|
@@ -235,6 +239,7 @@ declare module "node:quic" {
|
|
|
235
239
|
*/
|
|
236
240
|
enableDatagrams?: boolean | undefined;
|
|
237
241
|
}
|
|
242
|
+
type SessionApplicationOptions = { [K in keyof ApplicationOptions]-?: ApplicationOptions[K] & (bigint | boolean) };
|
|
238
243
|
/**
|
|
239
244
|
* @since v23.8.0
|
|
240
245
|
*/
|
|
@@ -539,6 +544,7 @@ declare module "node:quic" {
|
|
|
539
544
|
ongoaway?: QuicSession["ongoaway"] | undefined;
|
|
540
545
|
onkeylog?: QuicSession["onkeylog"] | undefined;
|
|
541
546
|
onqlog?: QuicSession["onqlog"] | undefined;
|
|
547
|
+
onapplication?: QuicSession["onapplication"] | undefined;
|
|
542
548
|
onheaders?: QuicStream["onheaders"] | undefined;
|
|
543
549
|
ontrailers?: QuicStream["ontrailers"] | undefined;
|
|
544
550
|
oninfo?: QuicStream["oninfo"] | undefined;
|
|
@@ -608,6 +614,20 @@ declare module "node:quic" {
|
|
|
608
614
|
* @since v23.8.0
|
|
609
615
|
*/
|
|
610
616
|
function listen(onsession: OnSessionCallback, options?: SessionOptions): Promise<QuicEndpoint>;
|
|
617
|
+
interface ListEndpointsOptions {
|
|
618
|
+
/**
|
|
619
|
+
* If `true` (the default), only returns endpoints that are
|
|
620
|
+
* active (not destroyed, not closing, and not busy). If `false` returns all
|
|
621
|
+
* endpoints.
|
|
622
|
+
*/
|
|
623
|
+
active?: boolean | undefined;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Returns the list of all `QuicEndpoint` instances. By default, only active
|
|
627
|
+
* endpoints are returned.
|
|
628
|
+
* @since v26.4.0
|
|
629
|
+
*/
|
|
630
|
+
function listEndpoints(options?: ListEndpointsOptions): QuicEndpoint[];
|
|
611
631
|
/**
|
|
612
632
|
* The endpoint configuration options passed when constructing a new `QuicEndpoint` instance.
|
|
613
633
|
* @since v23.8.0
|
|
@@ -1172,7 +1192,7 @@ declare module "node:quic" {
|
|
|
1172
1192
|
* be negotiated separately from the transport parameters. Read only.
|
|
1173
1193
|
* @since v26.3.0
|
|
1174
1194
|
*/
|
|
1175
|
-
readonly applicationOptions:
|
|
1195
|
+
readonly applicationOptions: SessionApplicationOptions;
|
|
1176
1196
|
/**
|
|
1177
1197
|
* Initiate a graceful close of the session. Existing streams will be allowed
|
|
1178
1198
|
* to complete but no new streams will be opened. Once all streams have closed,
|
|
@@ -1226,6 +1246,11 @@ declare module "node:quic" {
|
|
|
1226
1246
|
* @since v23.8.0
|
|
1227
1247
|
*/
|
|
1228
1248
|
readonly endpoint: QuicEndpoint | null;
|
|
1249
|
+
/**
|
|
1250
|
+
* The callback to invoke when new application options, e.g. HTTP/3 settings arrived.
|
|
1251
|
+
* @since v26.4
|
|
1252
|
+
*/
|
|
1253
|
+
onapplication: OnApplicationCallback | undefined;
|
|
1229
1254
|
/**
|
|
1230
1255
|
* An optional callback invoked when the session is destroyed with an error.
|
|
1231
1256
|
* This includes errors caused by user callbacks that throw or reject (see
|
|
@@ -1412,19 +1437,20 @@ declare module "node:quic" {
|
|
|
1412
1437
|
encoding?: BufferEncoding,
|
|
1413
1438
|
): Promise<bigint>;
|
|
1414
1439
|
/**
|
|
1415
|
-
* The local certificate as
|
|
1416
|
-
*
|
|
1417
|
-
*
|
|
1440
|
+
* The local certificate as a `crypto.X509Certificate` instance. Server
|
|
1441
|
+
* sessions return the certificate configured for the negotiated SNI host.
|
|
1442
|
+
* Client sessions return `undefined` unless a client certificate was sent.
|
|
1443
|
+
* Returns `undefined` if the session is destroyed.
|
|
1418
1444
|
* @since v26.2.0
|
|
1419
1445
|
*/
|
|
1420
|
-
readonly certificate:
|
|
1446
|
+
readonly certificate: X509Certificate | undefined;
|
|
1421
1447
|
/**
|
|
1422
|
-
* The peer's certificate as
|
|
1423
|
-
* `
|
|
1424
|
-
*
|
|
1448
|
+
* The peer's certificate as a `crypto.X509Certificate` instance. Returns
|
|
1449
|
+
* `undefined` if the peer did not present a certificate or the session is
|
|
1450
|
+
* destroyed.
|
|
1425
1451
|
* @since v26.2.0
|
|
1426
1452
|
*/
|
|
1427
|
-
readonly peerCertificate:
|
|
1453
|
+
readonly peerCertificate: X509Certificate | undefined;
|
|
1428
1454
|
/**
|
|
1429
1455
|
* The ephemeral key information for the session, with properties such as
|
|
1430
1456
|
* `type`, `name`, and `size`. Only available on client sessions. Returns
|
|
@@ -271,8 +271,8 @@ declare module "node:stream/iter" {
|
|
|
271
271
|
*
|
|
272
272
|
* If the object implements the `toAsyncStreamable` protocol (as
|
|
273
273
|
* `stream.Readable` does), that protocol is used. Otherwise, the function
|
|
274
|
-
* duck-types on `read()` and `
|
|
275
|
-
* a batched async iterator.
|
|
274
|
+
* duck-types on `read()`, `on()`, and `off()` (EventEmitter) and wraps the
|
|
275
|
+
* stream with a batched async iterator.
|
|
276
276
|
*
|
|
277
277
|
* The result is cached per instance -- calling `fromReadable()` twice with the
|
|
278
278
|
* same stream returns the same iterable.
|
|
@@ -294,7 +294,7 @@ declare module "node:stream/iter" {
|
|
|
294
294
|
* @since v26.1.0
|
|
295
295
|
* @experimental
|
|
296
296
|
* @param readable A classic Readable stream or any object
|
|
297
|
-
* with `read()` and `
|
|
297
|
+
* with `read()`, `on()` and `off()` methods.
|
|
298
298
|
* @returns A stream/iter async iterable source.
|
|
299
299
|
*/
|
|
300
300
|
function fromReadable(readable: NodeJS.ReadableStream): ByteReadableStream;
|
|
@@ -389,7 +389,7 @@ declare module "node:stream/iter" {
|
|
|
389
389
|
*
|
|
390
390
|
* Each `_write()` / `_writev()` call attempts the Writer's synchronous method
|
|
391
391
|
* first (`writeSync` / `writevSync`), falling back to the async method if the
|
|
392
|
-
* sync path returns `false
|
|
392
|
+
* sync path returns `false`. Similarly, `_final()` tries `endSync()`
|
|
393
393
|
* before `end()`. When the sync path succeeds, the callback is deferred via
|
|
394
394
|
* `queueMicrotask` to preserve the async resolution contract.
|
|
395
395
|
*
|
|
@@ -746,6 +746,7 @@ declare module "node:tls" {
|
|
|
746
746
|
// #endregion
|
|
747
747
|
}
|
|
748
748
|
type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
|
|
749
|
+
type CertificateCompressionAlgorithm = "zlib" | "brotli" | "zstd";
|
|
749
750
|
interface SecureContextOptions {
|
|
750
751
|
/**
|
|
751
752
|
* If set, this will be called when a client opens a connection using the ALPN extension.
|
|
@@ -782,6 +783,15 @@ declare module "node:tls" {
|
|
|
782
783
|
* able to validate the certificate, and the handshake will fail.
|
|
783
784
|
*/
|
|
784
785
|
cert?: string | Buffer | Array<string | Buffer> | undefined;
|
|
786
|
+
/**
|
|
787
|
+
* An array of supported certificate
|
|
788
|
+
* compression algorithm names, in preference order. Supported values are
|
|
789
|
+
* `'zlib'`, `'brotli'`, and `'zstd'`. When set, enables TLS certificate
|
|
790
|
+
* compression ([RFC 8879](https://tools.ietf.org/html/rfc8879)) which compresses certificates during the TLS
|
|
791
|
+
* handshake, reducing handshake size. Only effective with TLSv1.3.
|
|
792
|
+
* **Default:** `[]` (disabled).
|
|
793
|
+
*/
|
|
794
|
+
certificateCompression?: readonly CertificateCompressionAlgorithm[] | undefined;
|
|
785
795
|
/**
|
|
786
796
|
* Colon-separated list of supported signature algorithms. The list
|
|
787
797
|
* can contain digest algorithms (SHA256, MD5 etc.), public key
|
|
@@ -1110,6 +1120,20 @@ declare module "node:tls" {
|
|
|
1110
1120
|
* @since v0.10.2
|
|
1111
1121
|
*/
|
|
1112
1122
|
function getCiphers(): string[];
|
|
1123
|
+
/**
|
|
1124
|
+
* Returns an array with the names of the RFC 8879 certificate compression
|
|
1125
|
+
* algorithms supported by the current OpenSSL build, suitable for use in the
|
|
1126
|
+
* `certificateCompression` option of `tls.createSecureContext()`. Possible
|
|
1127
|
+
* values include `'zlib'`, `'brotli'`, and `'zstd'`.
|
|
1128
|
+
*
|
|
1129
|
+
* The array is empty when certificate compression is unavailable.
|
|
1130
|
+
*
|
|
1131
|
+
* ```js
|
|
1132
|
+
* console.log(tls.getCertificateCompressionAlgorithms()); // ['zlib', 'brotli', 'zstd']
|
|
1133
|
+
* ```
|
|
1134
|
+
* @since v26.4.0
|
|
1135
|
+
*/
|
|
1136
|
+
function getCertificateCompressionAlgorithms(): CertificateCompressionAlgorithm[];
|
|
1113
1137
|
/**
|
|
1114
1138
|
* Sets the default CA certificates used by Node.js TLS clients. If the provided
|
|
1115
1139
|
* certificates are parsed successfully, they will become the default CA
|
|
@@ -459,4 +459,9 @@ declare module "node:buffer" {
|
|
|
459
459
|
*/
|
|
460
460
|
type AllowSharedBuffer = Buffer;
|
|
461
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
464
|
+
* TypeScript versions earlier than 5.7.
|
|
465
|
+
*/
|
|
466
|
+
type BufferView<T extends NodeJS.ArrayBufferView> = Buffer;
|
|
462
467
|
}
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
/// <reference path="../util.d.ts" />
|
|
111
111
|
/// <reference path="../util/types.d.ts" />
|
|
112
112
|
/// <reference path="../v8.d.ts" />
|
|
113
|
+
/// <reference path="../vfs.d.ts" />
|
|
113
114
|
/// <reference path="../vm.d.ts" />
|
|
114
115
|
/// <reference path="../wasi.d.ts" />
|
|
115
116
|
/// <reference path="../worker_threads.d.ts" />
|