import { FastifyPluginAsync } from 'fastify'; declare module "fastify" { interface RouteSpecificOptions { layout?: string; } interface FastifyReply { view(page: string, data: T, opts?: RouteSpecificOptions): FastifyReply; view(page: string, data?: object, opts?: RouteSpecificOptions): FastifyReply; viewAsync(page: string, data: T, opts?: RouteSpecificOptions): Promise; viewAsync(page: string, data?: object, opts?: RouteSpecificOptions): Promise; } interface FastifyInstance { view(page: string, data: T, opts?: RouteSpecificOptions): Promise; view(page: string, data?: object, opts?: RouteSpecificOptions): Promise; } } type FastifyView = FastifyPluginAsync declare namespace fastifyView { export interface FastifyViewOptions { engine: { ejs?: any; eta?: any; nunjucks?: any; pug?: any; handlebars?: any; mustache?: any; 'art-template'?: any; twig?: any; liquid?: any; dot?: any; }; templates?: string | string[]; includeViewExtension?: boolean; options?: object; charset?: string; maxCache?: number; production?: boolean; defaultContext?: object; layout?: string; root?: string; viewExt?: string; propertyName?: string; asyncPropertyName?: string; } /** * @deprecated Use FastifyViewOptions */ export type PointOfViewOptions = FastifyViewOptions export const fastifyView: FastifyView export { fastifyView as default } export const fastifyViewCache: Symbol } declare function fastifyView(...params: Parameters): ReturnType export = fastifyView