From c3a7a0bd59016db1df778de523e6274e102467e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 26 Sep 2021 15:47:14 +0200 Subject: [PATCH] typings: define types for timers binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/40222 Reviewed-By: Tobias Nießen Reviewed-By: Evan Lucas Reviewed-By: Zijian Liu Reviewed-By: James M Snell Reviewed-By: Michael Dawson --- tsconfig.json | 1 + typings/internalBinding/timers.d.ts | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 typings/internalBinding/timers.d.ts diff --git a/tsconfig.json b/tsconfig.json index d1d6469f494f97..25000c2655994e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "./typings/internalBinding/messaging.d.ts", "./typings/internalBinding/options.d.ts", "./typings/internalBinding/serdes.d.ts", + "./typings/internalBinding/timers.d.ts", "./typings/internalBinding/util.d.ts", "./typings/internalBinding/worker.d.ts", "./typings/internalBinding.d.ts", diff --git a/typings/internalBinding/timers.d.ts b/typings/internalBinding/timers.d.ts new file mode 100644 index 00000000000000..fd6d40ecfee5cc --- /dev/null +++ b/typings/internalBinding/timers.d.ts @@ -0,0 +1,8 @@ +declare function InternalBinding(binding: 'timers'): { + getLibuvNow(): number; + setupTimers(immediateCallback: () => void, timersCallback: (now: number) => void): void; + scheduleTimer(msecs: number): void; + toggleTimerRef(value: boolean): void; + toggleImmediateRef(value: boolean): void; + immediateInfo: Uint32Array; +};