Skip to content

Commit cf9edbf

Browse files
authored
🤖 Merge PR DefinitelyTyped#72697 fix(diagnostics_channel): correct Channel.unbindStore() signature by @hkleungai
1 parent cf0cdd9 commit cf9edbf

File tree

6 files changed

+9
-3
lines changed

6 files changed

+9
-3
lines changed

‎types/node/diagnostics_channel.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ declare module "diagnostics_channel" {
259259
* @param store The store to unbind from the channel.
260260
* @return `true` if the store was found, `false` otherwise.
261261
*/
262-
unbindStore(store: any): void;
262+
unbindStore(store: AsyncLocalStorage<StoreType>): boolean;
263263
/**
264264
* Applies the given data to any AsyncLocalStorage instances bound to the channel
265265
* for the duration of the given function, then publishes to the channel within

‎types/node/test/diagnostics_channel.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ const hasSubs = hasSubscribers("test");
4747
channels.start.bindStore(store, (data) => {
4848
return data.requestId;
4949
});
50+
// $ExpectType boolean
51+
channels.start.unbindStore(store);
5052

5153
channels.subscribe({
5254
start(message) {

‎types/node/v18/diagnostics_channel.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ declare module "diagnostics_channel" {
260260
* @param store The store to unbind from the channel.
261261
* @return `true` if the store was found, `false` otherwise.
262262
*/
263-
unbindStore(store: any): void;
263+
unbindStore(store: AsyncLocalStorage<StoreType>): boolean;
264264
/**
265265
* Applies the given data to any AsyncLocalStorage instances bound to the channel
266266
* for the duration of the given function, then publishes to the channel within

‎types/node/v18/test/diagnostics_channel.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ const hasSubs = hasSubscribers("test");
4747
channels.start.bindStore(store, (data) => {
4848
return data.requestId;
4949
});
50+
// $ExpectType boolean
51+
channels.start.unbindStore(store);
5052

5153
channels.subscribe({
5254
start(message) {

‎types/node/v20/diagnostics_channel.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ declare module "diagnostics_channel" {
259259
* @param store The store to unbind from the channel.
260260
* @return `true` if the store was found, `false` otherwise.
261261
*/
262-
unbindStore(store: any): void;
262+
unbindStore(store: AsyncLocalStorage<StoreType>): boolean;
263263
/**
264264
* Applies the given data to any AsyncLocalStorage instances bound to the channel
265265
* for the duration of the given function, then publishes to the channel within

‎types/node/v20/test/diagnostics_channel.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ const hasSubs = hasSubscribers("test");
4747
channels.start.bindStore(store, (data) => {
4848
return data.requestId;
4949
});
50+
// $ExpectType boolean
51+
channels.start.unbindStore(store);
5052

5153
channels.subscribe({
5254
start(message) {

0 commit comments

Comments
 (0)