import { MinifierOptions as HTMLMinifierOptions } from 'html-minifier-next';
import { type TransformOptions } from 'lightningcss';
import { TemplatePart } from './models.js';
/**
* Allowed LightningCSS options that can be passed through.
* We exclude options that don't make sense for string-to-string transformation.
*/
export type CSSMinifierOptions = Omit, 'filename' | 'code' | 'sourceMap' | 'inputSourceMap' | 'projectRoot'>;
/**
* A strategy on how to minify HTML and optionally CSS.
*
* @template O minify HTML options
* @template C minify CSS options
*/
export interface Strategy {
/**
* Retrieve a placeholder for the given array of template parts. The
* placeholder returned should be the same if the function is invoked with the
* same array of parts.
*
* The placeholder should be an HTML-compliant string that is not present in
* any of the parts' text.
*
* @param parts the parts to get a placeholder for
* @returns the placeholder
*/
getPlaceholder(parts: TemplatePart[]): string;
/**
* Combines the parts' HTML text strings together into a single string using
* the provided placeholder. The placeholder indicates where a template
* expression occurs.
*
* @param parts the parts to combine
* @param placeholder the placeholder to use between parts
* @returns the combined parts' text strings
*/
combineHTMLStrings(parts: TemplatePart[], placeholder: string): string;
/**
* Minfies the provided HTML string.
*
* @param html the html to minify
* @param options html minify options
* @returns minified HTML string
*/
minifyHTML(html: string, options?: O): string | Promise;
/**
* Minifies the provided CSS string.
*
* @param css the css to minfiy
* @param options css minify options
* @returns minified CSS string
*/
minifyCSS?(css: string, options?: C): string;
/**
* Splits a minfied HTML string back into an array of strings from the
* provided placeholder. The returned array of strings should be the same
* length as the template parts that were combined to make the HTML string.
*
* @param html the html string to split
* @param placeholder the placeholder to split by
* @returns an array of html strings
*/
splitHTMLByPlaceholder(html: string, placeholder: string): string[];
}
/**
* The default LightningCSS options, optimized for production minification.
*/
export declare const defaultMinifyCSSOptions: CSSMinifierOptions;
/**
* The default html-minifier options, optimized for production
* minification.
*/
export declare const defaultMinifyOptions: HTMLMinifierOptions & {
minifyCSS: CSSMinifierOptions | false;
};
/**
* The default strategy. This uses html-minifier to minify HTML and
* lightningcss to minify CSS.
*/
export declare const defaultStrategy: Strategy;
//# sourceMappingURL=strategy.d.ts.map