import type { APIContext, MiddlewareNext } from "astro"; import { type HtmlnanoOptions, type HtmlnanoPreset } from "htmlnano"; /** * Minify Astro files with HTMLNano and CSSNano in the production mode * * @example Create `./src/middleware.ts` with the following content: * * ```ts * import { getAstroHTMLNano } from "astro-htmlnano" * * export const onRequest = getAstroHTMLNano() * ``` * * @param options The HTMLNano options to use when transforming the HTML files * @param htmlnanoPreset The HTMLNano preset to use * @returns A middleware function that can be used in Astro * @note this is only enabled when `process.env.NODE_ENV === "production"` */ export declare function getAstroHTMLNano(options?: HtmlnanoOptions, htmlnanoPreset?: HtmlnanoPreset): (_context: APIContext, next: MiddlewareNext) => Promise;