-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.d.ts
30 lines (24 loc) · 883 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { FastifyPluginCallback } from 'fastify'
import { EventEmitter } from 'events'
type FastifyGracefulShutdownPlugin =
FastifyPluginCallback<fastifyGracefulShutdown.fastifyGracefulShutdownOptions>
declare module 'fastify' {
interface FastifyInstance {
gracefulShutdown(
handler: (signal: string) => Promise<void> | void,
): void
}
}
declare namespace fastifyGracefulShutdown {
export type fastifyGracefulShutdownOptions = {
timeout?: number
resetHandlersOnInit?: boolean
handlerEventListener?: EventEmitter & { exit(code?: number): never }
}
export const fastifyGracefulShutdown: FastifyGracefulShutdownPlugin
export { fastifyGracefulShutdown as default }
}
declare function fastifyGracefulShutdown(
...params: Parameters<FastifyGracefulShutdownPlugin>
): ReturnType<FastifyGracefulShutdownPlugin>
export = fastifyGracefulShutdown