Skip to content

Commit ee54dfb

Browse files
authored
🤖 Merge PR DefinitelyTyped#74610 node: v25.5 by @Renegade334
1 parent 62ae6ea commit ee54dfb

14 files changed

Lines changed: 313 additions & 11 deletions

File tree

types/node/fs.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3553,10 +3553,12 @@ declare module "node:fs" {
35533553
*/
35543554
function unwatchFile(filename: PathLike, listener?: StatsListener): void;
35553555
function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
3556+
type WatchIgnorePredicate = string | RegExp | ((filename: string) => boolean);
35563557
interface WatchOptions extends Abortable {
35573558
encoding?: BufferEncoding | "buffer" | undefined;
35583559
persistent?: boolean | undefined;
35593560
recursive?: boolean | undefined;
3561+
ignore?: WatchIgnorePredicate | readonly WatchIgnorePredicate[] | undefined;
35603562
}
35613563
interface WatchOptionsWithBufferEncoding extends WatchOptions {
35623564
encoding: "buffer";

types/node/inspector.d.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,51 @@ declare module "node:inspector" {
218218
*/
219219
function put(url: string, data: string): void;
220220
}
221+
namespace DOMStorage {
222+
/**
223+
* This feature is only available with the
224+
* `--experimental-storage-inspection` flag enabled.
225+
*
226+
* Broadcasts the `DOMStorage.domStorageItemAdded` event to connected frontends.
227+
* This event indicates that a new item has been added to the storage.
228+
* @since v25.5.0
229+
*/
230+
function domStorageItemAdded(params: DomStorageItemAddedEventDataType): void;
231+
/**
232+
* This feature is only available with the
233+
* `--experimental-storage-inspection` flag enabled.
234+
*
235+
* Broadcasts the `DOMStorage.domStorageItemRemoved` event to connected frontends.
236+
* This event indicates that an item has been removed from the storage.
237+
* @since v25.5.0
238+
*/
239+
function domStorageItemRemoved(params: DomStorageItemRemovedEventDataType): void;
240+
/**
241+
* This feature is only available with the
242+
* `--experimental-storage-inspection` flag enabled.
243+
244+
* Broadcasts the `DOMStorage.domStorageItemUpdated` event to connected frontends.
245+
* This event indicates that a storage item has been updated.
246+
* @since v25.5.0
247+
*/
248+
function domStorageItemUpdated(params: DomStorageItemUpdatedEventDataType): void;
249+
/**
250+
* This feature is only available with the
251+
* `--experimental-storage-inspection` flag enabled.
252+
*
253+
* Broadcasts the `DOMStorage.domStorageItemsCleared` event to connected
254+
* frontends. This event indicates that all items have been cleared from the
255+
* storage.
256+
* @since v25.5.0
257+
*/
258+
function domStorageItemsCleared(params: DomStorageItemsClearedEventDataType): void;
259+
/**
260+
* This feature is only available with the
261+
* `--experimental-storage-inspection` flag enabled.
262+
* @since v25.5.0
263+
*/
264+
function registerStorage(params: unknown): void;
265+
}
221266
}
222267
declare module "inspector" {
223268
export * from "node:inspector";

types/node/inspector.generated.d.ts

Lines changed: 162 additions & 0 deletions
Large diffs are not rendered by default.

types/node/node-tests/fs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ async function testPromisify() {
267267
persistent: true,
268268
encoding: "utf8",
269269
signal: new AbortSignal(),
270+
ignore: (filename) => filename.startsWith("_"),
270271
}, (event, filename) => {
271272
console.log(event, filename);
272273
});

types/node/node-tests/sqlite.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,23 @@ import { TextEncoder } from "node:util";
7373
}
7474

7575
{
76-
new DatabaseSync(":memory:", {
76+
const db = new DatabaseSync(":memory:", {
7777
timeout: 10_000,
7878
readBigInts: true,
7979
returnArrays: true,
8080
allowBareNamedParameters: false,
8181
allowUnknownNamedParameters: true,
8282
});
83+
84+
const stmt = db.prepare("SELECT 1", {
85+
readBigInts: true,
86+
returnArrays: true,
87+
allowBareNamedParameters: false,
88+
allowUnknownNamedParameters: true,
89+
});
90+
91+
// $ExpectType SQLOutputValue
92+
stmt.get()![0];
8393
}
8494

8595
{

types/node/node-tests/test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
before,
77
beforeEach,
88
describe,
9+
expectFailure,
910
it,
1011
Mock,
1112
mock,
@@ -222,6 +223,7 @@ describe("options with values", {
222223
skip: "reason for skip",
223224
timeout: Infinity,
224225
todo: "reason for todo",
226+
expectFailure: true,
225227
});
226228

227229
it("options with values", {
@@ -231,6 +233,7 @@ it("options with values", {
231233
skip: "reason for skip",
232234
timeout: Infinity,
233235
todo: "reason for todo",
236+
expectFailure: true,
234237
});
235238

236239
describe("options with booleans", {
@@ -341,6 +344,39 @@ it.only("only shorthand", {
341344
timeout: Infinity,
342345
});
343346

347+
expectFailure("x", {
348+
concurrency: 1,
349+
only: true,
350+
signal: new AbortController().signal,
351+
timeout: Infinity,
352+
});
353+
expectFailure((t, cb) => {
354+
// $ExpectType TestContext
355+
t;
356+
// $ExpectType (result?: any) => void
357+
cb;
358+
// $ExpectType void
359+
cb({ x: "anything" });
360+
});
361+
test.expectFailure("x", {
362+
concurrency: 1,
363+
only: true,
364+
signal: new AbortController().signal,
365+
timeout: Infinity,
366+
});
367+
describe.expectFailure("x", {
368+
concurrency: 1,
369+
only: true,
370+
signal: new AbortController().signal,
371+
timeout: Infinity,
372+
});
373+
it.expectFailure("x", {
374+
concurrency: 1,
375+
only: true,
376+
signal: new AbortController().signal,
377+
timeout: Infinity,
378+
});
379+
344380
// Test with suite context
345381
describe(s => {
346382
// $ExpectType SuiteContext

types/node/node-tests/tls.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,26 +277,31 @@ import {
277277
socket = socket.addListener("OCSPResponse", (response) => {
278278
const _response: Buffer = response;
279279
});
280+
socket = socket.addListener("secure", () => {});
280281
socket = socket.addListener("secureConnect", () => {});
281282

282283
socket = socket.on("OCSPResponse", (response) => {
283284
const _response: Buffer = response;
284285
});
286+
socket = socket.on("secure", () => {});
285287
socket = socket.on("secureConnect", () => {});
286288

287289
socket = socket.once("OCSPResponse", (response) => {
288290
const _response: Buffer = response;
289291
});
292+
socket = socket.once("secure", () => {});
290293
socket = socket.once("secureConnect", () => {});
291294

292295
socket = socket.prependListener("OCSPResponse", (response) => {
293296
const _response: Buffer = response;
294297
});
298+
socket = socket.prependListener("secure", () => {});
295299
socket = socket.prependListener("secureConnect", () => {});
296300

297301
socket = socket.prependOnceListener("OCSPResponse", (response) => {
298302
const _response: Buffer = response;
299303
});
304+
socket = socket.prependOnceListener("secure", () => {});
300305
socket = socket.prependOnceListener("secureConnect", () => {});
301306

302307
socket.once("session", (buff: Buffer) => {});

types/node/node-tests/v8.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ v8.takeCoverage();
1919
v8.stopCoverage();
2020

2121
{
22-
const profiler = new v8.GCProfiler();
22+
using profiler = new v8.GCProfiler();
2323
profiler.start();
24-
setTimeout(() => {
25-
console.log(profiler.stop());
26-
}, 1000);
24+
profiler.stop();
2725
}
2826

2927
const disable = v8.promiseHooks.createHook({

types/node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/node",
4-
"version": "25.4.9999",
4+
"version": "25.5.9999",
55
"nonNpm": "conflict",
66
"nonNpmDescription": "Node.js",
77
"projects": [

types/node/process.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,8 @@ declare module "node:process" {
729729
* arguments passed when the Node.js process was launched. The first element will
730730
* be {@link execPath}. See `process.argv0` if access to the original value
731731
* of `argv[0]` is needed. The second element will be the path to the JavaScript
732-
* file being executed. The remaining elements will be any additional command-line
732+
* file being executed. If a [program entry point](https://nodejs.org/docs/latest-v25.x/api/cli.html#program-entry-point) was provided, the second element
733+
* will be the absolute path to it. The remaining elements are additional command-line
733734
* arguments.
734735
*
735736
* For example, assuming the following script for `process-args.js`:

0 commit comments

Comments
 (0)