Skip to content

Commit 3936334

Browse files
committed
feat: add typescript support
1 parent 0c3b9f8 commit 3936334

6 files changed

+486
-2
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
# Logs
23
logs
34
*.log

index.d.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {
2+
FastifyPluginCallback,
3+
FastifyPluginAsync,
4+
} from 'fastify'
5+
6+
export interface TrapsPluginOptions {
7+
timeout: number,
8+
onSignal: (signal: 'SIGTERM' | 'SIGINT') => {},
9+
onClose: () => {},
10+
onTimeout: (timeout: number) => {},
11+
onError: (error: Error|any) => {},
12+
strict: boolean
13+
}
14+
15+
export const trapsPluginCallback: FastifyPluginCallback<TrapsPluginOptions>;
16+
export const trapsPluginAsync: FastifyPluginAsync<TrapsPluginOptions>;
17+
18+
export default trapsPluginCallback;

0 commit comments

Comments
 (0)