import type { Readable } from 'node:stream'; import type { FastifyInstance, FastifyPluginCallback } from 'fastify'; import type { ViteDevServer } from 'vite'; import type { ModuleRunner } from 'vite/module-runner'; import { type FastifyViteDecorationPriorToSetup } from './mode/support.ts'; import type { ClientEntries, ClientModule } from './types/client.ts'; import type { HtmlTemplateFunction } from './types/html.ts'; import type { DevRuntimeConfig, FastifyViteOptions, ProdRuntimeConfig, RuntimeConfig } from './types/options.ts'; import type { RendererOption } from './types/renderer.ts'; import type { ReplyDotHtmlFunction, ReplyDotRenderContext, ReplyDotRenderFunction, ReplyDotRenderResult } from './types/reply.ts'; import type { ClientRouteArgs, CreateRouteArgs, RouteDefinition } from './types/route.ts'; import type { SerializableViteConfig } from './types/vite-configs.ts'; export type { ClientEntries, ClientModule, ClientRouteArgs, CreateRouteArgs, DevRuntimeConfig, FastifyViteOptions, HtmlTemplateFunction, ProdRuntimeConfig, RendererOption, ReplyDotHtmlFunction as HtmlFunction, ReplyDotRenderContext as RenderContext, ReplyDotRenderFunction as RenderFunction, ReplyDotRenderResult as RenderResult, RouteDefinition, RuntimeConfig, SerializableViteConfig, }; declare module 'fastify' { interface FastifyReply { html(ctx?: ReplyDotRenderResult): FastifyReply | string | Readable | Promise; render(ctx?: ReplyDotRenderContext): ReplyDotRenderResult | Promise; } interface FastifyInstance { vite: FastifyViteDecoration; } } declare const kMode: unique symbol; declare const kOptions: unique symbol; declare class FastifyViteDecoration implements FastifyViteDecorationPriorToSetup { scope: FastifyInstance; createServer?: unknown; runtimeConfig: RuntimeConfig; devServer?: ViteDevServer; entries?: ClientEntries; runners?: Record; [key: symbol]: unknown; private [kOptions]; private [kMode]; constructor(scope: FastifyInstance, options: FastifyViteOptions); /** * Completes @fastify/vite runtime initialization. * * This is intentionally not run during plugin registration; call * `await server.vite.ready()` when your app is ready to start Vite setup, * decorate reply methods, and register client-derived routes. */ ready(): Promise; } declare const fastifyVite: FastifyPluginCallback; export default fastifyVite; export { fastifyVite }; //# sourceMappingURL=index.d.ts.map