-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import { FastifyPluginCallback, RawServerBase, RawServerDefault } from "fastify"; | ||
import { | ||
Options as AjvOptions | ||
} from "ajv"; | ||
import { Options as AjvOptions } from "ajv"; | ||
|
||
declare module 'fastify' { | ||
interface RouteShorthandOptions< | ||
RawServer extends RawServerBase = RawServerDefault | ||
> { | ||
interface RouteShorthandOptions<RawServer extends RawServerBase = RawServerDefault> { | ||
responseValidation?: boolean; | ||
} | ||
} | ||
|
||
declare namespace FastifyResponseValidationPlugin { | ||
interface Options { | ||
type FastifyResponseValidation = FastifyPluginCallback<fastifyResponseValidation.Options>; | ||
|
||
declare namespace fastifyResponseValidation { | ||
export interface Options { | ||
ajv?: AjvOptions & { | ||
plugins?: (Function | [Function, unknown])[]; | ||
}; | ||
responseValidation?: boolean; | ||
} | ||
|
||
export const fastifyReponseValidation: FastifyResponseValidation | ||
export { fastifyReponseValidation as default } | ||
} | ||
|
||
declare const FastifyResponseValidationPlugin: FastifyPluginCallback<FastifyResponseValidationPlugin.Options>; | ||
export default FastifyResponseValidationPlugin; | ||
declare function fastifyResponseValidation(...params: Parameters<FastifyResponseValidation>): ReturnType<FastifyResponseValidation> | ||
export = fastifyResponseValidation |