@types/node 18.11.10 → 18.11.12
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.
- node/README.md +1 -1
- node/diagnostics_channel.d.ts +5 -5
- node/package.json +2 -2
- node/timers/promises.d.ts +25 -0
- node/ts4.8/diagnostics_channel.d.ts +5 -5
- node/ts4.8/timers/promises.d.ts +25 -0
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 08 Dec 2022 19:33:07 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
|
|
14
14
|
|
node/diagnostics_channel.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare module 'diagnostics_channel' {
|
|
|
41
41
|
* @param name The channel name
|
|
42
42
|
* @return If there are active subscribers
|
|
43
43
|
*/
|
|
44
|
-
function hasSubscribers(name: string): boolean;
|
|
44
|
+
function hasSubscribers(name: string | symbol): boolean;
|
|
45
45
|
/**
|
|
46
46
|
* This is the primary entry-point for anyone wanting to interact with a named
|
|
47
47
|
* channel. It produces a channel object which is optimized to reduce overhead at
|
|
@@ -56,8 +56,8 @@ declare module 'diagnostics_channel' {
|
|
|
56
56
|
* @param name The channel name
|
|
57
57
|
* @return The named channel object
|
|
58
58
|
*/
|
|
59
|
-
function channel(name: string): Channel;
|
|
60
|
-
type ChannelListener = (message: unknown, name: string) => void;
|
|
59
|
+
function channel(name: string | symbol): Channel;
|
|
60
|
+
type ChannelListener = (message: unknown, name: string | symbol) => void;
|
|
61
61
|
/**
|
|
62
62
|
* The class `Channel` represents an individual named channel within the data
|
|
63
63
|
* pipeline. It is use to track subscribers and to publish messages when there
|
|
@@ -68,7 +68,7 @@ declare module 'diagnostics_channel' {
|
|
|
68
68
|
* @since v15.1.0, v14.17.0
|
|
69
69
|
*/
|
|
70
70
|
class Channel {
|
|
71
|
-
readonly name: string;
|
|
71
|
+
readonly name: string | symbol;
|
|
72
72
|
/**
|
|
73
73
|
* Check if there are active subscribers to this channel. This is helpful if
|
|
74
74
|
* the message you want to send might be expensive to prepare.
|
|
@@ -88,7 +88,7 @@ declare module 'diagnostics_channel' {
|
|
|
88
88
|
* @since v15.1.0, v14.17.0
|
|
89
89
|
*/
|
|
90
90
|
readonly hasSubscribers: boolean;
|
|
91
|
-
private constructor(name: string);
|
|
91
|
+
private constructor(name: string | symbol);
|
|
92
92
|
/**
|
|
93
93
|
* Publish a message to any subscribers to the channel. This will
|
|
94
94
|
* trigger message handlers synchronously so they will execute within
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "18.11.
|
|
3
|
+
"version": "18.11.12",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -227,6 +227,6 @@
|
|
|
227
227
|
},
|
|
228
228
|
"scripts": {},
|
|
229
229
|
"dependencies": {},
|
|
230
|
-
"typesPublisherContentHash": "
|
|
230
|
+
"typesPublisherContentHash": "2ed250cec160c67c38316dcb3b85ce697b127871af3e4202c93f1e00d50af82c",
|
|
231
231
|
"typeScriptVersion": "4.2"
|
|
232
232
|
}
|
node/timers/promises.d.ts
CHANGED
|
@@ -62,6 +62,31 @@ declare module 'timers/promises' {
|
|
|
62
62
|
* @since v15.9.0
|
|
63
63
|
*/
|
|
64
64
|
function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
|
|
65
|
+
|
|
66
|
+
interface Scheduler {
|
|
67
|
+
/**
|
|
68
|
+
* ```js
|
|
69
|
+
* import { scheduler } from 'node:timers/promises';
|
|
70
|
+
*
|
|
71
|
+
* await scheduler.wait(1000); // Wait one second before continuing
|
|
72
|
+
* ```
|
|
73
|
+
* An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
|
|
74
|
+
* Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported.
|
|
75
|
+
* @since v16.14.0
|
|
76
|
+
* @experimental
|
|
77
|
+
* @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
|
|
78
|
+
*/
|
|
79
|
+
wait: (delay?: number, options?: TimerOptions) => Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
|
|
82
|
+
* Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments.
|
|
83
|
+
* @since v16.14.0
|
|
84
|
+
* @experimental
|
|
85
|
+
*/
|
|
86
|
+
yield: () => Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const scheduler: Scheduler;
|
|
65
90
|
}
|
|
66
91
|
declare module 'node:timers/promises' {
|
|
67
92
|
export * from 'timers/promises';
|
|
@@ -41,7 +41,7 @@ declare module 'diagnostics_channel' {
|
|
|
41
41
|
* @param name The channel name
|
|
42
42
|
* @return If there are active subscribers
|
|
43
43
|
*/
|
|
44
|
-
function hasSubscribers(name: string): boolean;
|
|
44
|
+
function hasSubscribers(name: string | symbol): boolean;
|
|
45
45
|
/**
|
|
46
46
|
* This is the primary entry-point for anyone wanting to interact with a named
|
|
47
47
|
* channel. It produces a channel object which is optimized to reduce overhead at
|
|
@@ -56,8 +56,8 @@ declare module 'diagnostics_channel' {
|
|
|
56
56
|
* @param name The channel name
|
|
57
57
|
* @return The named channel object
|
|
58
58
|
*/
|
|
59
|
-
function channel(name: string): Channel;
|
|
60
|
-
type ChannelListener = (message: unknown, name: string) => void;
|
|
59
|
+
function channel(name: string | symbol): Channel;
|
|
60
|
+
type ChannelListener = (message: unknown, name: string | symbol) => void;
|
|
61
61
|
/**
|
|
62
62
|
* The class `Channel` represents an individual named channel within the data
|
|
63
63
|
* pipeline. It is use to track subscribers and to publish messages when there
|
|
@@ -68,7 +68,7 @@ declare module 'diagnostics_channel' {
|
|
|
68
68
|
* @since v15.1.0, v14.17.0
|
|
69
69
|
*/
|
|
70
70
|
class Channel {
|
|
71
|
-
readonly name: string;
|
|
71
|
+
readonly name: string | symbol;
|
|
72
72
|
/**
|
|
73
73
|
* Check if there are active subscribers to this channel. This is helpful if
|
|
74
74
|
* the message you want to send might be expensive to prepare.
|
|
@@ -88,7 +88,7 @@ declare module 'diagnostics_channel' {
|
|
|
88
88
|
* @since v15.1.0, v14.17.0
|
|
89
89
|
*/
|
|
90
90
|
readonly hasSubscribers: boolean;
|
|
91
|
-
private constructor(name: string);
|
|
91
|
+
private constructor(name: string | symbol);
|
|
92
92
|
/**
|
|
93
93
|
* Publish a message to any subscribers to the channel. This will
|
|
94
94
|
* trigger message handlers synchronously so they will execute within
|
node/ts4.8/timers/promises.d.ts
CHANGED
|
@@ -62,6 +62,31 @@ declare module 'timers/promises' {
|
|
|
62
62
|
* @since v15.9.0
|
|
63
63
|
*/
|
|
64
64
|
function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
|
|
65
|
+
|
|
66
|
+
interface Scheduler {
|
|
67
|
+
/**
|
|
68
|
+
* ```js
|
|
69
|
+
* import { scheduler } from 'node:timers/promises';
|
|
70
|
+
*
|
|
71
|
+
* await scheduler.wait(1000); // Wait one second before continuing
|
|
72
|
+
* ```
|
|
73
|
+
* An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
|
|
74
|
+
* Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported.
|
|
75
|
+
* @since v16.14.0
|
|
76
|
+
* @experimental
|
|
77
|
+
* @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
|
|
78
|
+
*/
|
|
79
|
+
wait: (delay?: number, options?: TimerOptions) => Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
|
|
82
|
+
* Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments.
|
|
83
|
+
* @since v16.14.0
|
|
84
|
+
* @experimental
|
|
85
|
+
*/
|
|
86
|
+
yield: () => Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const scheduler: Scheduler;
|
|
65
90
|
}
|
|
66
91
|
declare module 'node:timers/promises' {
|
|
67
92
|
export * from 'timers/promises';
|