1 | import { FastifyInstance } from './instance'
|
2 | import { RawServerBase, RawRequestDefaultExpression, RawReplyDefaultExpression, RawServerDefault } from './utils'
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export type FastifyPluginCallback<Options extends FastifyPluginOptions = {}, Server extends RawServerBase = RawServerDefault> = (
|
10 | instance: FastifyInstance<Server, RawRequestDefaultExpression<Server>, RawReplyDefaultExpression<Server>>,
|
11 | opts: Options,
|
12 | next: (err?: Error) => void
|
13 | ) => void
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export type FastifyPluginAsync<Options extends FastifyPluginOptions = {}, Server extends RawServerBase = RawServerDefault> = (
|
21 | instance: FastifyInstance<Server, RawRequestDefaultExpression<Server>, RawReplyDefaultExpression<Server>>,
|
22 | opts: Options
|
23 | ) => Promise<void>;
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export type FastifyPlugin<Options extends FastifyPluginOptions = {}> = FastifyPluginCallback<Options> | FastifyPluginAsync<Options>
|
30 |
|
31 | export interface FastifyPluginOptions {
|
32 | [key: string]: any;
|
33 | }
|