import { Plugin } from 'vite'; type StaticParamPrimitive = string | number | boolean; type StaticParamValue = StaticParamPrimitive | StaticParamPrimitive[]; interface StaticParamRecord { [key: string]: StaticParamValue; } type HtPageParamValue = string | string[] | undefined; type HtPageParams = Record; interface HtPageInfo { id: string; entryPath: string; absolutePath: string; relativePath: string; routePattern: string; routePath: string; fileName: string; dynamic: boolean; paramNames: string[]; paramDefinitions: RouteParamDefinition[]; params: HtPageParams; } type HtPageRenderResult = string | unknown; type HtPageRenderResultAsync = HtPageRenderResult | Promise; type HtPageRenderContext = { page: HtPageInfo; params: HtPageParams; data?: unknown; dev: boolean; }; interface HtStructuredPageModule { render: (ctx: { page: HtPageInfo; params: HtPageParams; data?: TData; dev: boolean; }) => HtPageRenderResultAsync; data?: (ctx: { page: HtPageInfo; params: HtPageParams; dev: boolean; }) => TData | Promise; generateStaticParams?: () => Array | Promise>; dynamic?: boolean; prerender?: boolean; } interface HtPageModule { default?: ((ctx: { page: HtPageInfo; params: HtPageParams; data?: unknown; dev: boolean; }) => HtPageRenderResultAsync) | string | HtStructuredPageModule; data?: (ctx: { page: HtPageInfo; params: HtPageParams; dev: boolean; }) => unknown | Promise; generateStaticParams?: () => Array | Promise>; dynamic?: boolean; prerender?: boolean; } interface HtPagesPluginOptions { root?: string; include?: string | string[]; exclude?: string | string[]; pagesDir?: string; pageExtensions?: string[]; cleanUrls?: boolean; debug?: boolean; renderConcurrency?: number; renderBatchSize?: number; site?: string; missingAssets?: 'error' | 'warn'; /** * Root-relative URLs that something other than this plugin serves — * a sibling plugin's middleware, a reverse proxy — and which therefore * have no file under `pagesDir` or `public/` to validate against. * Exempted from the missing-asset check. * * A trailing slash makes an entry a directory prefix (`'/su/'` covers * `/su/alert.js`); anything else must match the URL exactly. */ externalAssets?: string | string[]; rss?: { site: string; title?: string; description?: string; routePrefix?: string; }; mapOutputPath?: (page: HtPageInfo) => string; /** * Directory (relative to project root) where generated page helper * `.d.ts` files are written. Defaults to `.vite-plugin-html-pages/types`. */ generatedTypesDir?: string; /** * Label used in console, terminal, and overlay messages * (e.g. `[sitelo]`). Defaults to `vite-plugin-html-pages`. * Does not change the Vite plugin identity used for dedupe. */ displayName?: string; /** * Inject a small dev-only toolbar on rendered pages (route, source file, * params, island count, copy debug info). Default `true`. Production * builds never include it. */ devToolbar?: boolean; /** * Docs URL shown in the dev toolbar. Defaults to sitelo docs when * `displayName` is `"sitelo"`, otherwise the plugin GitHub repo. */ devToolbarDocsUrl?: string; } type RouteParamDefinition = { name: string; type: 'single' | 'catch-all' | 'optional-catch-all'; }; declare function htPages(options?: HtPagesPluginOptions): Plugin; type FetchCacheMode = 'auto' | 'memory' | 'fs' | 'none'; interface FetchWithCacheOptions { maxAge?: number; cacheKey?: string; forceRefresh?: boolean; cache?: FetchCacheMode; } declare function fetchWithCache(input: RequestInfo | URL, init?: RequestInit, options?: FetchWithCacheOptions): Promise; export { type FetchWithCacheOptions, type HtPageInfo, type HtPageModule, type HtPageRenderContext, type HtPagesPluginOptions, type StaticParamRecord, htPages as default, fetchWithCache };