import type { FastifyPluginAsync, FastifyRequest, FastifyReply } from 'fastify'; import type { ViteDevServer } from 'vite'; import type { OnAppRenderedHook, OnTemplateRenderedHook } from '../../vitrify-config.js'; type ProvideFn = (req: FastifyRequest, res: FastifyReply) => Promise>; export interface FastifySsrOptions { baseUrl?: string; provide?: ProvideFn; vitrifyDir?: URL; vite?: ViteDevServer; onAppRendered?: OnAppRenderedHook[]; onTemplateRendered?: OnTemplateRenderedHook[]; appDir?: URL; publicDir?: URL; mode?: string; host?: string; } declare const fastifySsrPlugin: FastifyPluginAsync; declare const renderHtml: (options: { url: string; req: FastifyRequest | { headers: Record; url: string; }; res: FastifyReply | Record; provide: Record; onAppRendered?: OnAppRenderedHook[]; onTemplateRendered?: OnTemplateRenderedHook[]; template: string; manifest: Record; render: any; }) => Promise; declare const loadSSRAssets: ({ mode, distDir }?: { mode?: "ssr" | "ssg"; distDir?: URL; }) => Promise<{ template: string; manifest: any; render: any; getRoutes: any; onAppRendered: any; onTemplateRendered: any; }>; export { fastifySsrPlugin, renderHtml, loadSSRAssets }; export type FastifySsrPlugin = typeof fastifySsrPlugin;