Skip to content

Commit

Permalink
Update typings
Browse files Browse the repository at this point in the history
Fix #325
  • Loading branch information
dev101 authored and dnlup committed Jan 15, 2024
1 parent f38aabc commit cf3a7b9
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import {
FastifyPluginCallback,
} from 'fastify-plugin'

export interface TrapsPluginOptions {
timeout?: number,
onSignal?: (signal: 'SIGTERM' | 'SIGINT') => void,
onClose?: () => void,
onTimeout?: (timeout: number) => void,
onError?: (error: Error|any) => void,
strict?: boolean
} from 'fastify'

type FastifyTrapsPlugin = FastifyPluginCallback<fastifyTraps.FastifyTrapsOptions>

declare namespace fastifyTraps {

export interface FastifyTrapsOptions {
timeout?: number,
onSignal?: (signal: 'SIGTERM' | 'SIGINT') => void,
onClose?: () => void,
onTimeout?: (timeout: number) => void,
onError?: (error: Error|any) => void,
strict?: boolean
}

export const fastifyTraps: FastifyTrapsPlugin
export { fastifyTraps as default }
}

const plugin: FastifyPluginCallback<TrapsPluginOptions>;
export = plugin;
declare function fastifyTraps(
...params: Parameters<FastifyTrapsPlugin>
): ReturnType<FastifyTrapsPlugin>

export = fastifyTraps;

0 comments on commit cf3a7b9

Please sign in to comment.