From 4912f19b290a06c603b00e268d49abebddc3fd6d Mon Sep 17 00:00:00 2001 From: Aaron Moat <2937187+AaronMoat@users.noreply.github.com> Date: Thu, 2 Jan 2025 23:48:51 +1100 Subject: [PATCH] Remove VoidFunction type (#6809) --- .changeset/four-bees-relate.md | 5 +++++ packages/utils/src/registerAbortSignalListener.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/four-bees-relate.md diff --git a/.changeset/four-bees-relate.md b/.changeset/four-bees-relate.md new file mode 100644 index 00000000000..56e21963891 --- /dev/null +++ b/.changeset/four-bees-relate.md @@ -0,0 +1,5 @@ +--- +'@graphql-tools/utils': patch +--- + +Remove use of `VoidFunction` type, which requires DOM types diff --git a/packages/utils/src/registerAbortSignalListener.ts b/packages/utils/src/registerAbortSignalListener.ts index d7a31121910..e0487390b4c 100644 --- a/packages/utils/src/registerAbortSignalListener.ts +++ b/packages/utils/src/registerAbortSignalListener.ts @@ -22,7 +22,7 @@ const getListenersOfAbortSignal = memoize1(function getListenersOfAbortSignal(si * "possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit." * warning occuring on Node.js */ -export function registerAbortSignalListener(signal: AbortSignal, listener: VoidFunction) { +export function registerAbortSignalListener(signal: AbortSignal, listener: () => void) { // If the signal is already aborted, call the listener immediately if (signal.aborted) { listener();