Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions types/node/crypto.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3633,7 +3633,7 @@ declare module "node:crypto" {
hash: HashAlgorithmIdentifier;
length?: number;
}
interface KangarooTwelveParams {
interface KangarooTwelveParams extends Algorithm {
customization?: NodeJS.BufferSource;
outputLength: number;
}
Expand Down Expand Up @@ -3706,7 +3706,7 @@ declare module "node:crypto" {
interface RsaPssParams extends Algorithm {
saltLength: number;
}
interface TurboShakeParams {
interface TurboShakeParams extends Algorithm {
domainSeparation?: number;
outputLength: number;
}
Expand Down
2 changes: 1 addition & 1 deletion types/node/dgram.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ declare module "node:dgram" {
* and the `'connect'` event is emitted on the next tick. Trying to call
* `connectSync()` on an already connected socket throws an
* `ERR_SOCKET_DGRAM_IS_CONNECTED` exception, and calling it while an
* asynchronous [`socket.bind()`][] is still in progress throws an
* asynchronous `socket.bind()` is still in progress throws an
* `ERR_SOCKET_ALREADY_BOUND` exception.
*
* `address` must be a numeric IP literal; `connectSync()` never performs DNS
Expand Down
40 changes: 18 additions & 22 deletions types/node/v24/async_hooks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,37 +123,31 @@ declare module "async_hooks" {
function triggerAsyncId(): number;
interface HookCallbacks {
/**
* Called when a class is constructed that has the possibility to emit an asynchronous event.
* @param asyncId A unique ID for the async resource
* @param type The type of the async resource
* @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created
* @param resource Reference to the resource representing the async operation, needs to be released during destroy
* The [`init` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#initasyncid-type-triggerasyncid-resource).
*/
init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
/**
* When an asynchronous operation is initiated or completes a callback is called to notify the user.
* The before callback is called just before said callback is executed.
* @param asyncId the unique identifier assigned to the resource about to execute the callback.
* The [`before` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#beforeasyncid).
*/
before?(asyncId: number): void;
/**
* Called immediately after the callback specified in `before` is completed.
*
* If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs.
* @param asyncId the unique identifier assigned to the resource which has executed the callback.
* The [`after` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#afterasyncid).
*/
after?(asyncId: number): void;
/**
* Called when a promise has resolve() called. This may not be in the same execution id
* as the promise itself.
* @param asyncId the unique id for the promise that was resolve()d.
* The [`promiseResolve` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promiseresolveasyncid).
*/
promiseResolve?(asyncId: number): void;
/**
* Called after the resource corresponding to asyncId is destroyed
* @param asyncId a unique ID for the async resource
* The [`destroy` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#destroyasyncid).
*/
destroy?(asyncId: number): void;
/**
* Whether the hook should track `Promise`s. Cannot be `false` if
* `promiseResolve` is set.
* @default true
*/
trackPromises?: boolean | undefined;
}
interface AsyncHook {
/**
Expand All @@ -174,7 +168,8 @@ declare module "async_hooks" {
*
* All callbacks are optional. For example, if only resource cleanup needs to
* be tracked, then only the `destroy` callback needs to be passed. The
* specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
* specifics of all functions that can be passed to `callbacks` is in the
* [Hook Callbacks](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#hook-callbacks) section.
*
* ```js
* import { createHook } from 'node:async_hooks';
Expand Down Expand Up @@ -202,12 +197,13 @@ declare module "async_hooks" {
* ```
*
* Because promises are asynchronous resources whose lifecycle is tracked
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises.
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and
* `destroy()` callbacks _must not_ be async functions that return promises.
* @since v8.1.0
* @param callbacks The `Hook Callbacks` to register
* @return Instance used for disabling and enabling hooks
* @param options The [Hook Callbacks](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#hook-callbacks) to register
* @returns Instance used for disabling and enabling hooks
*/
function createHook(callbacks: HookCallbacks): AsyncHook;
function createHook(options: HookCallbacks): AsyncHook;
interface AsyncResourceOptions {
/**
* The ID of the execution context that created this async event.
Expand Down
15 changes: 10 additions & 5 deletions types/node/v24/buffer.buffer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ declare module "buffer" {
* such `Buffer` instances with zeroes.
*
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
* allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
* allows applications to avoid the garbage collection overhead of creating many
* individually allocated `Buffer` instances. This approach improves both
* performance and memory usage by eliminating the need to track and clean up as
* many individual `ArrayBuffer` objects.
* allocations less than `Buffer.poolSize >>> 1` (32KiB when default poolSize is used) are sliced
* from a single pre-allocated `Buffer`. This allows applications to avoid the
* garbage collection overhead of creating many individually allocated `Buffer`
* instances. This approach improves both performance and memory usage by
* eliminating the need to track and clean up as many individual `ArrayBuffer` objects.
*
* However, in the case where a developer may need to retain a small chunk of
* memory from a pool for an indeterminate amount of time, it may be appropriate
Expand Down Expand Up @@ -469,4 +469,9 @@ declare module "buffer" {
new(size: number): Buffer<ArrayBuffer>;
prototype: Buffer;
};
/**
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
* TypeScript versions earlier than 5.7.
*/
type BufferView<T extends NodeJS.ArrayBufferView> = T extends NodeJS.ArrayBufferView<infer B> ? Buffer<B> : never;
}
7 changes: 7 additions & 0 deletions types/node/v24/buffer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ declare module "buffer" {
* @since v16.7.0
*/
stream(): WebReadableStream;
/**
* Returns a new `ReadableStream` that allows the content of the `Blob` to be read
* as a stream of UTF-8 decoded strings. It is equivalent to piping
* `blob.stream()` through a `TextDecoderStream` set up with UTF-8.
* @since v24.19.0
*/
textStream(): WebReadableStream<string>;
}
export interface FileOptions {
/**
Expand Down
6 changes: 5 additions & 1 deletion types/node/v24/child_process.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ declare module "child_process" {
/**
* The `subprocess.exitCode` property indicates the exit code of the child process.
* If the child process is still running, the field will be `null`.
*
* When the child process is terminated by a signal, `subprocess.exitCode` will be
* `null` and `subprocess.signalCode` will be set. To get the corresponding
* POSIX exit code, use
* `util.convertProcessSignalToExitCode(subprocess.signalCode)`.
*/
readonly exitCode: number | null;
/**
Expand Down Expand Up @@ -281,7 +286,6 @@ declare module "child_process" {
* new process in a shell or with the use of the `shell` option of `ChildProcess`:
*
* ```js
* 'use strict';
* import { spawn } from 'node:child_process';
*
* const subprocess = spawn(
Expand Down
Loading