From 9019c7fa30a49875af19f988a36eee959183e89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20Nor=C3=B0fj=C3=B6r=C3=B0?= Date: Sat, 2 Apr 2022 19:44:44 -0400 Subject: [PATCH] feat: Improve typescript typings --- index.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index 827d0b7..1ca6ece 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,7 +1,9 @@ -export function onShutdown( - name: (() => Promise) | string | string[], - dependencies?: (() => Promise) | string[], - handler?: () => Promise -): void; +interface OnShutdown { + (handler: ()=> Promise): void + (name: string, handler: ()=> Promise): void + (name: string, dependencies: string[], handler: ()=> Promise): void +} + +export const onShutdown: OnShutdown export function onShutdownError(callback: (error: Error) => Promise): void;