Skip to content

Commit

Permalink
feat: Improve typescript typings
Browse files Browse the repository at this point in the history
  • Loading branch information
nordfjord authored and nikitaeverywhere committed Apr 10, 2022
1 parent 5c2a6c1 commit 9019c7f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export function onShutdown(
name: (() => Promise<void>) | string | string[],
dependencies?: (() => Promise<void>) | string[],
handler?: () => Promise<void>
): void;
interface OnShutdown {
(handler: ()=> Promise<void>): void
(name: string, handler: ()=> Promise<void>): void
(name: string, dependencies: string[], handler: ()=> Promise<void>): void
}

export const onShutdown: OnShutdown

export function onShutdownError(callback: (error: Error) => Promise<void>): void;

0 comments on commit 9019c7f

Please sign in to comment.