import type { Context } from "../types.js"; import { Plugin } from "@webiny/plugins"; import type { FastifyReply, FastifyRequest } from "fastify"; /** * If the execution of the callable returns false, no more plugins will be executed after the given one. * Nor it will execute our default OPTIONS code. * * This way users can prevent stopping of the request on our built-in OPTIONS request. */ export type HandlerOnRequestPluginCallableResponse = false | undefined | null | void; interface HandlerOnRequestPluginCallable { (request: FastifyRequest, reply: FastifyReply, context: C): Promise; } export declare class HandlerOnRequestPlugin extends Plugin { static type: string; private readonly cb; constructor(cb: HandlerOnRequestPluginCallable); exec(request: FastifyRequest, reply: FastifyReply, context: C): Promise; } export declare const createHandlerOnRequest: (cb: HandlerOnRequestPluginCallable) => HandlerOnRequestPlugin; export {};