UNPKG

@wroud/vite-plugin-ssg

Version:

A Vite plugin for static site generation (SSG) with React. Renders React applications to static HTML for faster load times and improved SEO.

14 lines 868 B
import type { HtmlTagDescriptor } from "vite"; import type { IndexComponent, IndexComponentContext } from "./IndexComponent.js"; import type { IAppContext } from "../app/IAppContext.js"; import { AppInstance } from "../app/AppInstance.js"; export type BoundServerApiFunction<T extends IAppContext = IAppContext> = (context: IndexComponentContext) => Promise<IServerAPI<T>>; export interface IServerAPI<T extends IAppContext> { appStartData: T; context: IndexComponentContext; render: (htmlTags: HtmlTagDescriptor[], timeout?: number) => Promise<string>; getPathsToPrerender: () => Promise<string[]>; dispose: () => Promise<void>; } export declare function create<T extends IAppContext>(indexOrApp: IndexComponent | AppInstance<T>, context: IndexComponentContext, mainScriptUrl?: string): Promise<IServerAPI<T>>; //# sourceMappingURL=server.d.ts.map