diff --git a/types/index.d.ts b/types/index.d.ts index 963bae0e..e8ba8ef7 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -2,18 +2,16 @@ // Leo /// -import { FastifyPluginAsync, FastifyRequest, RouteOptions } from 'fastify' +import { FastifyPluginAsync, FastifyRequest, RouteOptions, FastifyReply } from 'fastify' import { Stats } from 'fs' -declare module 'fastify' { - interface FastifyReply { - sendFile(filename: string, rootPath?: string): FastifyReply; - sendFile(filename: string, options?: fastifyStatic.SendOptions): FastifyReply; - sendFile(filename: string, rootPath?: string, options?: fastifyStatic.SendOptions): FastifyReply; - download(filepath: string, options?: fastifyStatic.SendOptions): FastifyReply; - download(filepath: string, filename?: string): FastifyReply; - download(filepath: string, filename?: string, options?: fastifyStatic.SendOptions): FastifyReply; - } +export class StaticReplyMixin { + sendFile(filename: string, rootPath?: string): FastifyReply; + sendFile(filename: string, options?: fastifyStatic.SendOptions): FastifyReply; + sendFile(filename: string, rootPath?: string, options?: fastifyStatic.SendOptions): FastifyReply; + download(filepath: string, options?: fastifyStatic.SendOptions): FastifyReply; + download(filepath: string, filename?: string): FastifyReply; + download(filepath: string, filename?: string, options?: fastifyStatic.SendOptions): FastifyReply; } type FastifyStaticPlugin = FastifyPluginAsync>;