forked from fastify/fastify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.d.ts
More file actions
20 lines (18 loc) · 769 Bytes
/
plugin.d.ts
File metadata and controls
20 lines (18 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { FastifyInstance } from './instance'
import { FastifyError } from './error'
import { RawServerBase, RawServerDefault, RawRequestDefaultExpression, RawReplyDefaultExpression } from './utils'
/**
* FastifyPlugin
*
* Fastify allows the user to extend its functionalities with plugins. A plugin can be a set of routes, a server decorator or whatever. To activate plugins, use the `fastify.register()` method.
*/
export interface FastifyPlugin<Options extends FastifyPluginOptions = {}> {
(
instance: FastifyInstance<RawServerBase, RawRequestDefaultExpression<RawServerBase>, RawReplyDefaultExpression<RawServerBase>>,
opts: Options,
next: (err?: FastifyError) => void
): void;
}
export interface FastifyPluginOptions {
[key: string]: any;
}