1 |
|
2 |
|
3 | import {
|
4 | FastifyPluginCallback,
|
5 | FastifyPluginAsync,
|
6 | } from 'fastify'
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export default function fp<Options>(fn: FastifyPluginAsync<Options>, options?: PluginMetadata): FastifyPluginAsync<Options>;
|
17 | export default function fp<Options>(fn: FastifyPluginAsync<Options>, options?: string): FastifyPluginAsync<Options>;
|
18 | export default function fp<Options>(fn: FastifyPluginCallback<Options>, options?: PluginMetadata): FastifyPluginCallback<Options>;
|
19 | export default function fp<Options>(fn: FastifyPluginCallback<Options>, options?: string): FastifyPluginCallback<Options>;
|
20 |
|
21 | export interface PluginMetadata {
|
22 |
|
23 | fastify?: string,
|
24 | name?: string,
|
25 |
|
26 | decorators?: {
|
27 | fastify?: string[],
|
28 | reply?: string[],
|
29 | request?: string[]
|
30 | },
|
31 |
|
32 | dependencies?: string[]
|
33 | }
|
34 |
|
35 |
|
36 | export interface PluginOptions extends PluginMetadata {}
|